diff options
Diffstat (limited to 'net/ipv4/igmp.c')
-rw-r--r-- | net/ipv4/igmp.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 12b65ccca8e9..1fd3d9ce8398 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -321,15 +321,12 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size) | |||
321 | } | 321 | } |
322 | igmp_skb_size(skb) = size; | 322 | igmp_skb_size(skb) = size; |
323 | 323 | ||
324 | { | 324 | rt = ip_route_output_ports(net, NULL, IGMPV3_ALL_MCR, 0, |
325 | struct flowi fl = { .oif = dev->ifindex, | 325 | 0, 0, |
326 | .fl4_dst = IGMPV3_ALL_MCR, | 326 | IPPROTO_IGMP, 0, dev->ifindex); |
327 | .proto = IPPROTO_IGMP }; | 327 | if (IS_ERR(rt)) { |
328 | rt = ip_route_output_key(net, &fl); | 328 | kfree_skb(skb); |
329 | if (IS_ERR(rt)) { | 329 | return NULL; |
330 | kfree_skb(skb); | ||
331 | return NULL; | ||
332 | } | ||
333 | } | 330 | } |
334 | if (rt->rt_src == 0) { | 331 | if (rt->rt_src == 0) { |
335 | kfree_skb(skb); | 332 | kfree_skb(skb); |
@@ -667,14 +664,12 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc, | |||
667 | else | 664 | else |
668 | dst = group; | 665 | dst = group; |
669 | 666 | ||
670 | { | 667 | rt = ip_route_output_ports(net, NULL, dst, 0, |
671 | struct flowi fl = { .oif = dev->ifindex, | 668 | 0, 0, |
672 | .fl4_dst = dst, | 669 | IPPROTO_IGMP, 0, dev->ifindex); |
673 | .proto = IPPROTO_IGMP }; | 670 | if (IS_ERR(rt)) |
674 | rt = ip_route_output_key(net, &fl); | 671 | return -1; |
675 | if (IS_ERR(rt)) | 672 | |
676 | return -1; | ||
677 | } | ||
678 | if (rt->rt_src == 0) { | 673 | if (rt->rt_src == 0) { |
679 | ip_rt_put(rt); | 674 | ip_rt_put(rt); |
680 | return -1; | 675 | return -1; |
@@ -1441,7 +1436,6 @@ void ip_mc_destroy_dev(struct in_device *in_dev) | |||
1441 | /* RTNL is locked */ | 1436 | /* RTNL is locked */ |
1442 | static struct in_device *ip_mc_find_dev(struct net *net, struct ip_mreqn *imr) | 1437 | static struct in_device *ip_mc_find_dev(struct net *net, struct ip_mreqn *imr) |
1443 | { | 1438 | { |
1444 | struct flowi fl = { .fl4_dst = imr->imr_multiaddr.s_addr }; | ||
1445 | struct net_device *dev = NULL; | 1439 | struct net_device *dev = NULL; |
1446 | struct in_device *idev = NULL; | 1440 | struct in_device *idev = NULL; |
1447 | 1441 | ||
@@ -1456,7 +1450,9 @@ static struct in_device *ip_mc_find_dev(struct net *net, struct ip_mreqn *imr) | |||
1456 | } | 1450 | } |
1457 | 1451 | ||
1458 | if (!dev) { | 1452 | if (!dev) { |
1459 | struct rtable *rt = ip_route_output_key(net, &fl); | 1453 | struct rtable *rt = ip_route_output(net, |
1454 | imr->imr_multiaddr.s_addr, | ||
1455 | 0, 0, 0); | ||
1460 | if (!IS_ERR(rt)) { | 1456 | if (!IS_ERR(rt)) { |
1461 | dev = rt->dst.dev; | 1457 | dev = rt->dst.dev; |
1462 | ip_rt_put(rt); | 1458 | ip_rt_put(rt); |