Skip to content

Commit

Permalink
ipv6: Fix regression caused by efe4208 in udp_v6_mcast_next()
Browse files Browse the repository at this point in the history
Commit efe4208 ("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: Sven Wegener <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
swegener authored and davem330 committed Jun 4, 2014
1 parent d8b0426 commit 3bfdc59
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/ipv6/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,15 +716,15 @@ static struct sock *udp_v6_mcast_next(struct net *net, struct sock *sk,
if (inet->inet_dport != rmt_port)
continue;
}
if (!ipv6_addr_any(&sk->sk_v6_daddr) &&
!ipv6_addr_equal(&sk->sk_v6_daddr, rmt_addr))
if (!ipv6_addr_any(&s->sk_v6_daddr) &&
!ipv6_addr_equal(&s->sk_v6_daddr, rmt_addr))
continue;

if (s->sk_bound_dev_if && s->sk_bound_dev_if != dif)
continue;

if (!ipv6_addr_any(&sk->sk_v6_rcv_saddr)) {
if (!ipv6_addr_equal(&sk->sk_v6_rcv_saddr, loc_addr))
if (!ipv6_addr_any(&s->sk_v6_rcv_saddr)) {
if (!ipv6_addr_equal(&s->sk_v6_rcv_saddr, loc_addr))
continue;
}
if (!inet6_mc_check(s, loc_addr, rmt_addr))
Expand Down

0 comments on commit 3bfdc59

Please sign in to comment.