Skip to content

Commit

Permalink
[SK_BUFF]: Use the helpers to get the layer header pointer
Browse files Browse the repository at this point in the history
Some more cases...

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Arnaldo Carvalho de Melo authored and David S. Miller committed Apr 26, 2007
1 parent 514bca3 commit bff9b61
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion net/ipv4/igmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/ip_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
/*
* 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;

Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/exthdrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp)
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)
Expand Down
4 changes: 2 additions & 2 deletions net/ipv6/netfilter/nf_conntrack_reasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit bff9b61

Please sign in to comment.