aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/igmp.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-02 17:31:35 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-02 17:31:35 -0500
commitb23dd4fe42b455af5c6e20966b7d6959fa8352ea (patch)
treebf97323eae9a8d084170e573ff2c0c40bc72c3cd /net/ipv4/igmp.c
parent452edd598f60522c11f7f88fdbab27eb36509d1a (diff)
ipv4: Make output route lookup return rtable directly.
Instead of on the stack. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/igmp.c')
-rw-r--r--net/ipv4/igmp.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index e0e77e297de3..44ba9068b72f 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -325,7 +325,8 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
325 struct flowi fl = { .oif = dev->ifindex, 325 struct flowi fl = { .oif = dev->ifindex,
326 .fl4_dst = IGMPV3_ALL_MCR, 326 .fl4_dst = IGMPV3_ALL_MCR,
327 .proto = IPPROTO_IGMP }; 327 .proto = IPPROTO_IGMP };
328 if (ip_route_output_key(net, &rt, &fl)) { 328 rt = ip_route_output_key(net, &fl);
329 if (IS_ERR(rt)) {
329 kfree_skb(skb); 330 kfree_skb(skb);
330 return NULL; 331 return NULL;
331 } 332 }
@@ -670,7 +671,8 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
670 struct flowi fl = { .oif = dev->ifindex, 671 struct flowi fl = { .oif = dev->ifindex,
671 .fl4_dst = dst, 672 .fl4_dst = dst,
672 .proto = IPPROTO_IGMP }; 673 .proto = IPPROTO_IGMP };
673 if (ip_route_output_key(net, &rt, &fl)) 674 rt = ip_route_output_key(net, &fl);
675 if (IS_ERR(rt))
674 return -1; 676 return -1;
675 } 677 }
676 if (rt->rt_src == 0) { 678 if (rt->rt_src == 0) {
@@ -1440,7 +1442,6 @@ void ip_mc_destroy_dev(struct in_device *in_dev)
1440static struct in_device *ip_mc_find_dev(struct net *net, struct ip_mreqn *imr) 1442static struct in_device *ip_mc_find_dev(struct net *net, struct ip_mreqn *imr)
1441{ 1443{
1442 struct flowi fl = { .fl4_dst = imr->imr_multiaddr.s_addr }; 1444 struct flowi fl = { .fl4_dst = imr->imr_multiaddr.s_addr };
1443 struct rtable *rt;
1444 struct net_device *dev = NULL; 1445 struct net_device *dev = NULL;
1445 struct in_device *idev = NULL; 1446 struct in_device *idev = NULL;
1446 1447
@@ -1454,9 +1455,12 @@ static struct in_device *ip_mc_find_dev(struct net *net, struct ip_mreqn *imr)
1454 return NULL; 1455 return NULL;
1455 } 1456 }
1456 1457
1457 if (!dev && !ip_route_output_key(net, &rt, &fl)) { 1458 if (!dev) {
1458 dev = rt->dst.dev; 1459 struct rtable *rt = ip_route_output_key(net, &fl);
1459 ip_rt_put(rt); 1460 if (!IS_ERR(rt)) {
1461 dev = rt->dst.dev;
1462 ip_rt_put(rt);
1463 }
1460 } 1464 }
1461 if (dev) { 1465 if (dev) {
1462 imr->imr_ifindex = dev->ifindex; 1466 imr->imr_ifindex = dev->ifindex;