Skip to content

Commit 9341b98

Browse files
idoschdavem330
authored andcommitted
bridge: Export multicast enabled state
During enslavement to a bridge, after the CHANGEUPPER is sent, the multicast enabled state of the bridge isn't propagated down to the offloading driver unless it's changed. This patch allows such drivers to query the multicast enabled state from the bridge, so that they'll be able to correctly configure their flood tables during port enslavement. In case multicast is disabled, unregistered multicast packets can be treated as broadcast and be flooded through all the bridge ports. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1f51445 commit 9341b98

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

include/linux/if_bridge.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ int br_multicast_list_adjacent(struct net_device *dev,
6262
struct list_head *br_ip_list);
6363
bool br_multicast_has_querier_anywhere(struct net_device *dev, int proto);
6464
bool br_multicast_has_querier_adjacent(struct net_device *dev, int proto);
65+
bool br_multicast_enabled(const struct net_device *dev);
6566
#else
6667
static inline int br_multicast_list_adjacent(struct net_device *dev,
6768
struct list_head *br_ip_list)
@@ -78,6 +79,10 @@ static inline bool br_multicast_has_querier_adjacent(struct net_device *dev,
7879
{
7980
return false;
8081
}
82+
static inline bool br_multicast_enabled(const struct net_device *dev)
83+
{
84+
return false;
85+
}
8186
#endif
8287

8388
#if IS_ENABLED(CONFIG_BRIDGE) && IS_ENABLED(CONFIG_BRIDGE_VLAN_FILTERING)

net/bridge/br_multicast.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,6 +2176,14 @@ int br_multicast_toggle(struct net_bridge *br, unsigned long val)
21762176
return err;
21772177
}
21782178

2179+
bool br_multicast_enabled(const struct net_device *dev)
2180+
{
2181+
struct net_bridge *br = netdev_priv(dev);
2182+
2183+
return !br->multicast_disabled;
2184+
}
2185+
EXPORT_SYMBOL_GPL(br_multicast_enabled);
2186+
21792187
int br_multicast_set_querier(struct net_bridge *br, unsigned long val)
21802188
{
21812189
unsigned long max_delay;

0 commit comments

Comments
 (0)