]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: flood multicast to CPU when slave has IFF_PROMISC
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 21 Apr 2022 22:42:22 +0000 (01:42 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Apr 2022 10:46:24 +0000 (11:46 +0100)
commitc59e17f2810bb21f73d2aeb0797f078266473905
tree8eeb1e55e74181cb02c3daf886415ffd9a833df5
parent30d05844ef3ee3c472b84db5f8c6a1b40621382b
net: dsa: flood multicast to CPU when slave has IFF_PROMISC

Certain DSA switches can eliminate flooding to the CPU when none of the
ports have the IFF_ALLMULTI or IFF_PROMISC flags set. This is done by
synthesizing a call to dsa_port_bridge_flags() for the CPU port, a call
which normally comes from the bridge driver via switchdev.

The bridge port flags and IFF_PROMISC|IFF_ALLMULTI have slightly
different semantics, and due to inattention/lack of proper testing, the
IFF_PROMISC flag allows unknown unicast to be flooded to the CPU, but
not unknown multicast.

This must be fixed by setting both BR_FLOOD (unicast) and BR_MCAST_FLOOD
in the synthesized dsa_port_bridge_flags() call, since IFF_PROMISC means
that packets should not be filtered regardless of their MAC DA.

Fixes: fc128f38e461 ("net: dsa: manage flooding on the CPU ports")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/slave.c