net: bridge: mcast: don't delete permanent entries when fast leave is enabled
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Tue, 30 Jul 2019 11:21:00 +0000 (14:21 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Jul 2019 23:03:01 +0000 (19:03 -0400)
commit5c725b6b65067909548ac9ca9bc777098ec9883d
tree068e74577645f018e57c30a1f0602b089e1fe593
parent271da132e29b5341c31eca6ba6a72ea1302ebac8
net: bridge: mcast: don't delete permanent entries when fast leave is enabled

When permanent entries were introduced by the commit below, they were
exempt from timing out and thus igmp leave wouldn't affect them unless
fast leave was enabled on the port which was added before permanent
entries existed. It shouldn't matter if fast leave is enabled or not
if the user added a permanent entry it shouldn't be deleted on igmp
leave.

Before:
$ echo 1 > /sys/class/net/eth4/brport/multicast_fast_leave
$ bridge mdb add dev br0 port eth4 grp 229.1.1.1 permanent
$ bridge mdb show
dev br0 port eth4 grp 229.1.1.1 permanent

< join and leave 229.1.1.1 on eth4 >

$ bridge mdb show
$

After:
$ echo 1 > /sys/class/net/eth4/brport/multicast_fast_leave
$ bridge mdb add dev br0 port eth4 grp 229.1.1.1 permanent
$ bridge mdb show
dev br0 port eth4 grp 229.1.1.1 permanent

< join and leave 229.1.1.1 on eth4 >

$ bridge mdb show
dev br0 port eth4 grp 229.1.1.1 permanent

Fixes: ccb1c31a7a87 ("bridge: add flags to distinguish permanent mdb entires")
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_multicast.c