macvlan: Fix mc_filter calculation
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 29 Mar 2023 08:45:33 +0000 (16:45 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 31 Mar 2023 07:56:42 +0000 (08:56 +0100)
commitae63ad9b2cc766bc4b3b6328e68dd27995abb0fe
treef1836d0c115737aa6e3cefc0957db18b8d8e97fd
parentce7928f7cf988e3f20ec3cca050838b266e9ef14
macvlan: Fix mc_filter calculation

On Wed, Mar 29, 2023 at 08:10:26AM +0000, patchwork-bot+netdevbpf@kernel.org wrote:
>
> Here is the summary with links:
>   - [1/2] macvlan: Skip broadcast queue if multicast with single receiver
>     https://git.kernel.org/netdev/net-next/c/d45276e75e90
>   - [2/2] macvlan: Add netlink attribute for broadcast cutoff
>     https://git.kernel.org/netdev/net-next/c/954d1fa1ac93

Sorry, I made an error and posted my patches from an earlier
revision so a follow-up fix was missing:

---8<---
The bc_cutoff patch broke the calculation of mc_filter causing
some multicast packets to not make it through to the targeted
device.

Fix this by checking whether vlan is set instead of cutoff >= 0.

Also move the cutoff < 0 logic into macvlan_recompute_bc_filter
so that it doesn't change the mc_filter at all.

Fixes: d45276e75e90 ("macvlan: Skip broadcast queue if multicast with single receiver")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvlan.c