Skip to contentSkip to conversation

ipv4: Remove erroneous check in igmpv3_newpack() and igmp_send_report().

PATCH In review David Miller 2 participants 2 messages Apr 26, 2011 – Apr 27, 2011

Subsystems (3)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 3/4 ipv4: Remove erroneous check in igmpv3_newpack() and igmp_send_report().

Output route resolution never returns a route with rt_src set to zero (which is INADDR_ANY).

Even if the flow key for the output route lookup specifies INADDR_ANY for the source address, the output route resolution chooses a real source address to use in the final route.

This test has existed forever in igmp_send_report() and David Stevens simply copied over the erroneous test when implementing support for IGMPv3.

---
 net/ipv4/igmp.c |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)
net/ipv4/igmp.c +0 -10
index 1fd3d9c..8ae0a57 100644
@@ -328,11 +328,6 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
 		kfree_skb(skb);
 		return NULL;
 	}
-	if (rt->rt_src == 0) {
-		kfree_skb(skb);
-		ip_rt_put(rt);
-		return NULL;
-	}
 
 	skb_dst_set(skb, &rt->dst);
 	skb->dev = dev;
@@ -670,11 +665,6 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
 	if (IS_ERR(rt))
 		return -1;
 
-	if (rt->rt_src == 0) {
-		ip_rt_put(rt);
-		return -1;
-	}
-
 	skb = alloc_skb(IGMP_SIZE+LL_ALLOCATED_SPACE(dev), GFP_ATOMIC);
 	if (skb == NULL) {
 		ip_rt_put(rt);
Signature · 1 line
1.7.4.5
Reviewed-by on v1 3/4
#1 lore raw
Quoted 7 lines · David Miller

Output route resolution never returns a route with rt_src set to zero (which is INADDR_ANY).

Even if the flow key for the output route lookup specifies INADDR_ANY for the source address, the output route resolution chooses a real source address to use in the final route.

Quoted 5 lines

This test has existed forever in igmp_send_report() and David Stevens simply copied over the erroneous test when implementing support for IGMPv3.