diff options
Diffstat (limited to 'net/ipv4/igmp.c')
-rw-r--r-- | net/ipv4/igmp.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index b2ca095cb9da..fa057d105bef 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -304,9 +304,11 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size) | |||
304 | struct igmpv3_report *pig; | 304 | struct igmpv3_report *pig; |
305 | struct net *net = dev_net(dev); | 305 | struct net *net = dev_net(dev); |
306 | struct flowi4 fl4; | 306 | struct flowi4 fl4; |
307 | int hlen = LL_RESERVED_SPACE(dev); | ||
308 | int tlen = dev->needed_tailroom; | ||
307 | 309 | ||
308 | while (1) { | 310 | while (1) { |
309 | skb = alloc_skb(size + LL_ALLOCATED_SPACE(dev), | 311 | skb = alloc_skb(size + hlen + tlen, |
310 | GFP_ATOMIC | __GFP_NOWARN); | 312 | GFP_ATOMIC | __GFP_NOWARN); |
311 | if (skb) | 313 | if (skb) |
312 | break; | 314 | break; |
@@ -327,7 +329,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size) | |||
327 | skb_dst_set(skb, &rt->dst); | 329 | skb_dst_set(skb, &rt->dst); |
328 | skb->dev = dev; | 330 | skb->dev = dev; |
329 | 331 | ||
330 | skb_reserve(skb, LL_RESERVED_SPACE(dev)); | 332 | skb_reserve(skb, hlen); |
331 | 333 | ||
332 | skb_reset_network_header(skb); | 334 | skb_reset_network_header(skb); |
333 | pip = ip_hdr(skb); | 335 | pip = ip_hdr(skb); |
@@ -647,6 +649,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc, | |||
647 | __be32 group = pmc ? pmc->multiaddr : 0; | 649 | __be32 group = pmc ? pmc->multiaddr : 0; |
648 | struct flowi4 fl4; | 650 | struct flowi4 fl4; |
649 | __be32 dst; | 651 | __be32 dst; |
652 | int hlen, tlen; | ||
650 | 653 | ||
651 | if (type == IGMPV3_HOST_MEMBERSHIP_REPORT) | 654 | if (type == IGMPV3_HOST_MEMBERSHIP_REPORT) |
652 | return igmpv3_send_report(in_dev, pmc); | 655 | return igmpv3_send_report(in_dev, pmc); |
@@ -661,7 +664,9 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc, | |||
661 | if (IS_ERR(rt)) | 664 | if (IS_ERR(rt)) |
662 | return -1; | 665 | return -1; |
663 | 666 | ||
664 | skb = alloc_skb(IGMP_SIZE+LL_ALLOCATED_SPACE(dev), GFP_ATOMIC); | 667 | hlen = LL_RESERVED_SPACE(dev); |
668 | tlen = dev->needed_tailroom; | ||
669 | skb = alloc_skb(IGMP_SIZE + hlen + tlen, GFP_ATOMIC); | ||
665 | if (skb == NULL) { | 670 | if (skb == NULL) { |
666 | ip_rt_put(rt); | 671 | ip_rt_put(rt); |
667 | return -1; | 672 | return -1; |
@@ -669,7 +674,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc, | |||
669 | 674 | ||
670 | skb_dst_set(skb, &rt->dst); | 675 | skb_dst_set(skb, &rt->dst); |
671 | 676 | ||
672 | skb_reserve(skb, LL_RESERVED_SPACE(dev)); | 677 | skb_reserve(skb, hlen); |
673 | 678 | ||
674 | skb_reset_network_header(skb); | 679 | skb_reset_network_header(skb); |
675 | iph = ip_hdr(skb); | 680 | iph = ip_hdr(skb); |
@@ -1574,7 +1579,7 @@ out_unlock: | |||
1574 | * Add multicast single-source filter to the interface list | 1579 | * Add multicast single-source filter to the interface list |
1575 | */ | 1580 | */ |
1576 | static int ip_mc_add1_src(struct ip_mc_list *pmc, int sfmode, | 1581 | static int ip_mc_add1_src(struct ip_mc_list *pmc, int sfmode, |
1577 | __be32 *psfsrc, int delta) | 1582 | __be32 *psfsrc) |
1578 | { | 1583 | { |
1579 | struct ip_sf_list *psf, *psf_prev; | 1584 | struct ip_sf_list *psf, *psf_prev; |
1580 | 1585 | ||
@@ -1709,7 +1714,7 @@ static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode, | |||
1709 | pmc->sfcount[sfmode]++; | 1714 | pmc->sfcount[sfmode]++; |
1710 | err = 0; | 1715 | err = 0; |
1711 | for (i=0; i<sfcount; i++) { | 1716 | for (i=0; i<sfcount; i++) { |
1712 | err = ip_mc_add1_src(pmc, sfmode, &psfsrc[i], delta); | 1717 | err = ip_mc_add1_src(pmc, sfmode, &psfsrc[i]); |
1713 | if (err) | 1718 | if (err) |
1714 | break; | 1719 | break; |
1715 | } | 1720 | } |