Commit 3bfdc59a authored by Sven Wegener's avatar Sven Wegener Committed by David S. Miller

ipv6: Fix regression caused by efe4208f in udp_v6_mcast_next()

Commit efe4208f ("ipv6: make lookups simpler and faster") introduced a
regression in udp_v6_mcast_next(), resulting in multicast packets not
reaching the destination sockets under certain conditions.

The packet's IPv6 addresses are wrongly compared to the IPv6 addresses
from the function's socket argument, which indicates the starting point
for looping, instead of the loop variable. If the addresses from the
first socket do not match the packet's addresses, no socket in the list
will match.
Signed-off-by: default avatarSven Wegener <sven.wegener@stealer.net>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d8b0426a
...@@ -716,15 +716,15 @@ static struct sock *udp_v6_mcast_next(struct net *net, struct sock *sk, ...@@ -716,15 +716,15 @@ static struct sock *udp_v6_mcast_next(struct net *net, struct sock *sk,
if (inet->inet_dport != rmt_port) if (inet->inet_dport != rmt_port)
continue; continue;
} }
if (!ipv6_addr_any(&sk->sk_v6_daddr) && if (!ipv6_addr_any(&s->sk_v6_daddr) &&
!ipv6_addr_equal(&sk->sk_v6_daddr, rmt_addr)) !ipv6_addr_equal(&s->sk_v6_daddr, rmt_addr))
continue; continue;
if (s->sk_bound_dev_if && s->sk_bound_dev_if != dif) if (s->sk_bound_dev_if && s->sk_bound_dev_if != dif)
continue; continue;
if (!ipv6_addr_any(&sk->sk_v6_rcv_saddr)) { if (!ipv6_addr_any(&s->sk_v6_rcv_saddr)) {
if (!ipv6_addr_equal(&sk->sk_v6_rcv_saddr, loc_addr)) if (!ipv6_addr_equal(&s->sk_v6_rcv_saddr, loc_addr))
continue; continue;
} }
if (!inet6_mc_check(s, loc_addr, rmt_addr)) if (!inet6_mc_check(s, loc_addr, rmt_addr))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment