From: David L Stevens Date: Thu, 15 Sep 2005 04:10:20 +0000 (-0700) Subject: [IPV6]: Fix per-socket multicast filtering in sk_reuse case X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=40796c5e8f2a93008e9034b3110a7e7b1fa0fba0;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [IPV6]: Fix per-socket multicast filtering in sk_reuse case per-socket multicast filters were not being applied to all sockets in the case of an exact-match bound address, due to an over-exuberant "return" in the look-up code. Fix below. IPv4 does not have this problem. Thanks to Hoerdt Mickael for reporting the bug. Signed-off-by: David L Stevens Signed-off-by: David S. Miller --- diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 69b146843a20..2b9bf9bd177f 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -405,9 +405,8 @@ static struct sock *udp_v6_mcast_next(struct sock *sk, continue; if (!ipv6_addr_any(&np->rcv_saddr)) { - if (ipv6_addr_equal(&np->rcv_saddr, loc_addr)) - return s; - continue; + if (!ipv6_addr_equal(&np->rcv_saddr, loc_addr)) + continue; } if(!inet6_mc_check(s, loc_addr, rmt_addr)) continue;