From 8fcffdc5cd2b12b6d7940ef951c7174c17dd86c6 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 16 Mar 2007 17:19:57 -0300 Subject: [PATCH 1/4] [SK_BUFF]: Use the helpers to get the layer header pointer Some more cases... Signed-off-by: Arnaldo Carvalho de Melo --- net/ipv4/igmp.c | 2 +- net/ipv4/ip_output.c | 2 +- net/ipv6/exthdrs.c | 2 +- net/ipv6/netfilter/nf_conntrack_reasm.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 1e49817..4d7213b 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -348,7 +348,7 @@ static int igmpv3_sendpack(struct sk_buff *skb) { struct iphdr *pip = ip_hdr(skb); struct igmphdr *pig = igmp_hdr(skb); - const int iplen = skb->tail - skb->nh.raw; + const int iplen = skb->tail - skb_network_header(skb); const int igmplen = skb->tail - skb_transport_header(skb); pip->tot_len = htons(iplen); diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 11ab100..11a6ac7 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -601,7 +601,7 @@ slow_path: /* * Copy a block of the IP datagram. */ - if (skb_copy_bits(skb, ptr, skb2->h.raw, len)) + if (skb_copy_bits(skb, ptr, skb_transport_header(skb2), len)) BUG(); left -= len; diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index 30857a8..ac64555 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c @@ -478,7 +478,7 @@ looped_back: kfree_skb(skb); *skbp = skb = skb2; opt = IP6CB(skb2); - hdr = (struct ipv6_rt_hdr *) skb2->h.raw; + hdr = (struct ipv6_rt_hdr *)skb_transport_header(skb2); } if (skb->ip_summed == CHECKSUM_COMPLETE) diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index 0159505..84ce5b3 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c @@ -627,7 +627,7 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev) /* We have to remove fragment header from datagram and to relocate * header in order to calculate ICV correctly. */ - skb_network_header(head)[fq->nhoffset] = head->h.raw[0]; + skb_network_header(head)[fq->nhoffset] = skb_transport_header(head)[0]; memmove(head->head + sizeof(struct frag_hdr), head->head, (head->data - head->head) - sizeof(struct frag_hdr)); head->mac.raw += sizeof(struct frag_hdr); @@ -787,7 +787,7 @@ struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb) skb_set_transport_header(clone, fhoff); hdr = ipv6_hdr(clone); - fhdr = (struct frag_hdr *)clone->h.raw; + fhdr = (struct frag_hdr *)skb_transport_header(clone); if (!(fhdr->frag_off & htons(0xFFF9))) { DEBUGP("Invalid fragment offset\n"); -- 1.5.0.3