]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit - net/bridge/br_multicast.c
net: bridge: always clear mcast matching struct on reports and leaves
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Wed, 3 Apr 2019 20:27:24 +0000 (23:27 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Apr 2019 00:52:40 +0000 (17:52 -0700)
commit1515a63fc413f160d20574ab0894e7f1020c7be2
tree331e885e68035cc53f61873a855f9a32ec4d40bd
parentcc5a726c79158bd307150e8d4176ec79b52001ea
net: bridge: always clear mcast matching struct on reports and leaves

We need to be careful and always zero the whole br_ip struct when it is
used for matching since the rhashtable change. This patch fixes all the
places which didn't properly clear it which in turn might've caused
mismatches.

Thanks for the great bug report with reproducing steps and bisection.

Steps to reproduce (from the bug report):
ip link add br0 type bridge mcast_querier 1
ip link set br0 up

ip link add v2 type veth peer name v3
ip link set v2 master br0
ip link set v2 up
ip link set v3 up
ip addr add 3.0.0.2/24 dev v3

ip netns add test
ip link add v1 type veth peer name v1 netns test
ip link set v1 master br0
ip link set v1 up
ip -n test link set v1 up
ip -n test addr add 3.0.0.1/24 dev v1

# Multicast receiver
ip netns exec test socat
UDP4-RECVFROM:5588,ip-add-membership=224.224.224.224:3.0.0.1,fork -

# Multicast sender
echo hello | nc -u -s 3.0.0.2 224.224.224.224 5588

Reported-by: liam.mcbirnie@boeing.com
Fixes: 19e3a9c90c53 ("net: bridge: convert multicast to generic rhashtable")
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_multicast.c