From: Eric Dumazet Date: Sat, 18 Jun 2011 18:59:18 +0000 (-0700) Subject: ipv4: fix multicast losses X-Git-Tag: v2.6.39.3~9 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9672388919350b5f188722ac608bdc32f9bc3c3d;p=karo-tx-linux.git ipv4: fix multicast losses [ Upstream commit 9aa3c94ce59066f545521033007abb6441706068 ] Knut Tidemann found that first packet of a multicast flow was not correctly received, and bisected the regression to commit b23dd4fe42b4 (Make output route lookup return rtable directly.) Special thanks to Knut, who provided a very nice bug report, including sample programs to demonstrate the bug. Reported-and-bisectedby: Knut Tidemann Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 99e6e4bb1c72..b8b5c3ff4045 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1914,9 +1914,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr, hash = rt_hash(daddr, saddr, dev->ifindex, rt_genid(dev_net(dev))); rth = rt_intern_hash(hash, rth, skb, dev->ifindex); - err = 0; - if (IS_ERR(rth)) - err = PTR_ERR(rth); + return IS_ERR(rth) ? PTR_ERR(rth) : 0; e_nobufs: return -ENOBUFS;