diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-04-21 01:47:35 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:25:10 -0400 |
commit | eddc9ec53be2ecdbf4efe0efd4a83052594f0ac0 (patch) | |
tree | 4a38ab4dbd9d61fdf5a5ea6ed61463e0b9e33ba7 /net/ipv4/igmp.c | |
parent | e023dd643798c4f06c16466af90b4d250e4b8bd7 (diff) |
[SK_BUFF]: Introduce ip_hdr(), remove skb->nh.iph
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/igmp.c')
-rw-r--r-- | net/ipv4/igmp.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 0687a7235a6c..f511d03e2439 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -315,7 +315,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size) | |||
315 | skb_reserve(skb, LL_RESERVED_SPACE(dev)); | 315 | skb_reserve(skb, LL_RESERVED_SPACE(dev)); |
316 | 316 | ||
317 | skb_reset_network_header(skb); | 317 | skb_reset_network_header(skb); |
318 | pip = skb->nh.iph; | 318 | pip = ip_hdr(skb); |
319 | skb_put(skb, sizeof(struct iphdr) + 4); | 319 | skb_put(skb, sizeof(struct iphdr) + 4); |
320 | 320 | ||
321 | pip->version = 4; | 321 | pip->version = 4; |
@@ -345,16 +345,14 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size) | |||
345 | 345 | ||
346 | static int igmpv3_sendpack(struct sk_buff *skb) | 346 | static int igmpv3_sendpack(struct sk_buff *skb) |
347 | { | 347 | { |
348 | struct iphdr *pip = skb->nh.iph; | 348 | struct iphdr *pip = ip_hdr(skb); |
349 | struct igmphdr *pig = skb->h.igmph; | 349 | struct igmphdr *pig = skb->h.igmph; |
350 | int iplen, igmplen; | 350 | const int iplen = skb->tail - skb->nh.raw; |
351 | const int igmplen = skb->tail - skb->h.raw; | ||
351 | 352 | ||
352 | iplen = skb->tail - (unsigned char *)skb->nh.iph; | ||
353 | pip->tot_len = htons(iplen); | 353 | pip->tot_len = htons(iplen); |
354 | ip_send_check(pip); | 354 | ip_send_check(pip); |
355 | 355 | pig->csum = ip_compute_csum(skb->h.igmph, igmplen); | |
356 | igmplen = skb->tail - (unsigned char *)skb->h.igmph; | ||
357 | pig->csum = ip_compute_csum((void *)skb->h.igmph, igmplen); | ||
358 | 356 | ||
359 | return NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, skb->dev, | 357 | return NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, skb->dev, |
360 | dst_output); | 358 | dst_output); |
@@ -667,7 +665,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc, | |||
667 | skb_reserve(skb, LL_RESERVED_SPACE(dev)); | 665 | skb_reserve(skb, LL_RESERVED_SPACE(dev)); |
668 | 666 | ||
669 | skb_reset_network_header(skb); | 667 | skb_reset_network_header(skb); |
670 | iph = skb->nh.iph; | 668 | iph = ip_hdr(skb); |
671 | skb_put(skb, sizeof(struct iphdr) + 4); | 669 | skb_put(skb, sizeof(struct iphdr) + 4); |
672 | 670 | ||
673 | iph->version = 4; | 671 | iph->version = 4; |