diff options
author | Henning Rogge <hrogge@gmail.com> | 2015-05-18 22:08:49 +0300 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-06-15 21:26:50 +0300 |
commit | 359aeb0ae4a0e461368d7859ceb79086901dea7e (patch) | |
tree | f7ea568a272bd6ced32018e8fa975007b2ae5943 /net | |
parent | dc3c6cb6eb811e8e27ff0acefb2cc7d16b1b976b (diff) | |
download | linux-359aeb0ae4a0e461368d7859ceb79086901dea7e.tar.xz |
net/ipv6/udp: Fix ipv6 multicast socket filter regression
[ Upstream commit 33b4b015e1a1ca7a8fdce40af5e71642a8ea355c ]
Commit <5cf3d46192fc> ("udp: Simplify__udp*_lib_mcast_deliver")
simplified the filter for incoming IPv6 multicast but removed
the check of the local socket address and the UDP destination
address.
This patch restores the filter to prevent sockets bound to a IPv6
multicast IP to receive other UDP traffic link unicast.
Signed-off-by: Henning Rogge <hrogge@gmail.com>
Fixes: 5cf3d46192fc ("udp: Simplify__udp*_lib_mcast_deliver")
Cc: "David S. Miller" <davem@davemloft.net>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/udp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index f6ba535b6feb..d6516910bf41 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -721,7 +721,9 @@ static bool __udp_v6_is_mcast_sock(struct net *net, struct sock *sk, (inet->inet_dport && inet->inet_dport != rmt_port) || (!ipv6_addr_any(&sk->sk_v6_daddr) && !ipv6_addr_equal(&sk->sk_v6_daddr, rmt_addr)) || - (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif)) + (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif) || + (!ipv6_addr_any(&sk->sk_v6_rcv_saddr) && + !ipv6_addr_equal(&sk->sk_v6_rcv_saddr, loc_addr))) return false; if (!inet6_mc_check(sk, loc_addr, rmt_addr)) return false; |