]> git.baikalelectronics.ru Git - kernel.git/commit
r8152: allow userland to disable multicast
authorSven van Ashbrook <svenva@chromium.org>
Tue, 30 Aug 2022 04:59:39 +0000 (04:59 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 31 Aug 2022 21:55:50 +0000 (14:55 -0700)
commitae938687a33125b2d83388c8de5d0aac0ca6c2c4
tree228cf5a5ea80c11a8c39e67727fc4833db0e9621
parenteaba1a26ea7dc9bfcc1d1cf71ab0346d8b2effe3
r8152: allow userland to disable multicast

The rtl8152 driver does not disable multicasting when userspace asks
it to. For example:
 $ ifconfig eth0 -multicast -allmulti
 $ tcpdump -p -i eth0  # will still capture multicast frames

Fix by clearing the device multicast filter table when multicast and
allmulti are both unset.

Tested as follows:
- Set multicast on eth0 network interface
- verify that multicast packets are coming in:
  $ tcpdump -p -i eth0
- Clear multicast and allmulti on eth0 network interface
- verify that no more multicast packets are coming in:
  $ tcpdump -p -i eth0

Signed-off-by: Sven van Ashbrook <svenva@chromium.org>
Acked-by: Hayes Wang <hayeswang@realtek.com>
Link: https://lore.kernel.org/r/20220830045923.net-next.v1.1.I4fee0ac057083d4f848caf0fa3a9fd466fc374a0@changeid
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/usb/r8152.c