X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fcore%2Fnetfilter.c;h=91b3bb238edc0d4e9ea4390e5ef31ad0306e064e;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=58632d189f52e3534f3e4a17909b442f450bd813;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/net/core/netfilter.c b/net/core/netfilter.c index 58632d189..91b3bb238 100644 --- a/net/core/netfilter.c +++ b/net/core/netfilter.c @@ -695,11 +695,12 @@ int skb_ip_make_writable(struct sk_buff **pskb, unsigned int writable_len) /* DaveM says protocol headers are also modifiable. */ switch ((*pskb)->nh.iph->protocol) { case IPPROTO_TCP: { - struct tcphdr hdr; - if (skb_copy_bits(*pskb, (*pskb)->nh.iph->ihl*4, - &hdr, sizeof(hdr)) != 0) + struct tcphdr _hdr, *hp; + hp = skb_header_pointer(*pskb, (*pskb)->nh.iph->ihl*4, + sizeof(_hdr), &_hdr); + if (hp == NULL) goto copy_skb; - if (writable_len <= (*pskb)->nh.iph->ihl*4 + hdr.doff*4) + if (writable_len <= (*pskb)->nh.iph->ihl*4 + hp->doff*4) goto pull_skb; goto copy_skb; } @@ -783,13 +784,12 @@ void nf_log_packet(int pf, nf_logfn *logfn; rcu_read_lock(); - logfn = nf_logging[pf]; + logfn = rcu_dereference(nf_logging[pf]); if (logfn) { va_start(args, fmt); vsnprintf(prefix, sizeof(prefix), fmt, args); va_end(args); /* We must read logging before nf_logfn[pf] */ - smp_read_barrier_depends(); logfn(hooknum, skb, in, out, prefix); } else if (!reported) { printk(KERN_WARNING "nf_log_packet: can\'t log yet, " @@ -806,7 +806,7 @@ EXPORT_SYMBOL(nf_log_packet); tracking in use: without this, connection may not be in hash table, and hence manufactured ICMP or RST packets will not be associated with it. */ -void (*ip_ct_attach)(struct sk_buff *, struct nf_ct_info *); +void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *); void __init netfilter_init(void) {