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)
commit7305b78ae45f2ce19fbb9e83d7a8c45214d2cdc9
tree228cf5a5ea80c11a8c39e67727fc4833db0e9621
parentf029c781dd6d8e2f13593c927c66db7e8826ed28
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