net: dsa: sja1105: fix leakage of flooded frames outside bridging domain
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 16 Feb 2021 11:41:19 +0000 (13:41 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Feb 2021 22:02:46 +0000 (14:02 -0800)
commit7f7ccdea8c730ff85ba9abc2297b9e2954d3ed19
treef274f922b50633cbda873252f5fcec2786fb3d4a
parent4c44fc5e94005ab325911de44d7935446781307a
net: dsa: sja1105: fix leakage of flooded frames outside bridging domain

Quite embarrasingly, I managed to fool myself into thinking that the
flooding domain of sja1105 source ports is restricted by the forwarding
domain, which it isn't. Frames which match an FDB entry are forwarded
towards that entry's DESTPORTS restricted by REACH_PORT[SRC_PORT], while
frames that don't match any FDB entry are forwarded towards
FL_DOMAIN[SRC_PORT] or BC_DOMAIN[SRC_PORT].

This means we can't get away with doing the simple thing, and we must
manage the flooding domain ourselves such that it is restricted by the
forwarding domain. This new function must be called from the
.port_bridge_join and .port_bridge_leave methods too, not just from
.port_bridge_flags as we did before.

Fixes: 4d9423549501 ("net: dsa: sja1105: offload bridge port flags to device")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105.h
drivers/net/dsa/sja1105/sja1105_main.c