Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: bridge: mcast: fix br_multicast_ctx_vlan_global_disabled helper

We need to first check if the context is a vlan one, then we need to
check the global bridge multicast vlan snooping flag, and finally the
vlan's multicast flag, otherwise we will unnecessarily enable vlan mcast
processing (e.g. querier timers).

Fixes: 7b54aaaf53cb ("net: bridge: multicast: add vlan state initialization and control")
Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Link: https://lore.kernel.org/r/20211228153142.536969-1-nikolay@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Nikolay Aleksandrov and committed by
Jakub Kicinski
168fed98 e22e45fc

+3 -3
+3 -3
net/bridge/br_private.h
··· 1153 1153 static inline bool 1154 1154 br_multicast_ctx_vlan_global_disabled(const struct net_bridge_mcast *brmctx) 1155 1155 { 1156 - return br_opt_get(brmctx->br, BROPT_MCAST_VLAN_SNOOPING_ENABLED) && 1157 - br_multicast_ctx_is_vlan(brmctx) && 1158 - !(brmctx->vlan->priv_flags & BR_VLFLAG_GLOBAL_MCAST_ENABLED); 1156 + return br_multicast_ctx_is_vlan(brmctx) && 1157 + (!br_opt_get(brmctx->br, BROPT_MCAST_VLAN_SNOOPING_ENABLED) || 1158 + !(brmctx->vlan->priv_flags & BR_VLFLAG_GLOBAL_MCAST_ENABLED)); 1159 1159 } 1160 1160 1161 1161 static inline bool