Commit bff9b61c authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller

[SK_BUFF]: Use the helpers to get the layer header pointer

Some more cases...
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 514bca32
...@@ -348,7 +348,7 @@ static int igmpv3_sendpack(struct sk_buff *skb) ...@@ -348,7 +348,7 @@ static int igmpv3_sendpack(struct sk_buff *skb)
{ {
struct iphdr *pip = ip_hdr(skb); struct iphdr *pip = ip_hdr(skb);
struct igmphdr *pig = igmp_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); const int igmplen = skb->tail - skb_transport_header(skb);
pip->tot_len = htons(iplen); pip->tot_len = htons(iplen);
......
...@@ -601,7 +601,7 @@ slow_path: ...@@ -601,7 +601,7 @@ slow_path:
/* /*
* Copy a block of the IP datagram. * 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(); BUG();
left -= len; left -= len;
......
...@@ -506,7 +506,7 @@ looped_back: ...@@ -506,7 +506,7 @@ looped_back:
kfree_skb(skb); kfree_skb(skb);
*skbp = skb = skb2; *skbp = skb = skb2;
opt = IP6CB(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) if (skb->ip_summed == CHECKSUM_COMPLETE)
......
...@@ -627,7 +627,7 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev) ...@@ -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 /* We have to remove fragment header from datagram and to relocate
* header in order to calculate ICV correctly. */ * 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, memmove(head->head + sizeof(struct frag_hdr), head->head,
(head->data - head->head) - sizeof(struct frag_hdr)); (head->data - head->head) - sizeof(struct frag_hdr));
head->mac.raw += 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) ...@@ -787,7 +787,7 @@ struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb)
skb_set_transport_header(clone, fhoff); skb_set_transport_header(clone, fhoff);
hdr = ipv6_hdr(clone); 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))) { if (!(fhdr->frag_off & htons(0xFFF9))) {
DEBUGP("Invalid fragment offset\n"); DEBUGP("Invalid fragment offset\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment