]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] fix IPv6 per-socket multicast filtering in exact-match case
authorDavid Stevens <dlstevens@us.ibm.com>
Thu, 15 Sep 2005 19:46:06 +0000 (13:46 -0600)
committerChris Wright <chrisw@osdl.org>
Mon, 3 Oct 2005 23:27:17 +0000 (16:27 -0700)
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 <dlstevens@us.ibm.com>
Signed-off-by: Chris Wright <chrisw@osdl.org>
net/ipv6/udp.c

index eff050ac7049601e6cc040c14210ac678b16e788..377f71ccf112f4cc47db40e8f71754b702a00ba5 100644 (file)
@@ -404,9 +404,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;