bridge: Add export of multicast database adjacent to net_dev
Subsystems (3)
RFC PATCH 1/1 bridge: Add export of multicast database adjacent to net_dev
With this new, exported function br_multicast_list_adjacent(net_dev) a list of IPv4/6 addresses is returned. This list contains all multicast addresses sensed by the bridge multicast snooping feature on all bridge ports of the bridge interface of net_dev, excluding addresses from the specified net_device itself.
A multicast optimization currently implemented for batman-adv requires this data.
Signed-off-by Linus Lüssing <[email protected]>
--- include/linux/if_bridge.h | 17 +++++++++++++ net/bridge/br_multicast.c | 59 +++++++++++++++++++++++++++++++++++++++++++++ net/bridge/br_private.h | 11 --------- 3 files changed, 76 insertions(+), 11 deletions(-)
include/linux/if_bridge.h +17 -0
@@ -16,9 +16,26 @@#include <linux/netdevice.h> #include <uapi/linux/if_bridge.h> +struct br_ip { +union { +__be32 ip4; +#if IS_ENABLED (CONFIG_IPV6 ) +struct in6_addr ip6; +#endif + } u; +__be16 proto; +}; + +struct br_ip_list { +struct list_head list; +struct br_ip addr; +}; +extern void brioctl_set (int (*ioctl_hook)(struct net *,unsigned int ,void __user *));typedef int br_should_route_hook_t (struct sk_buff *skb);extern br_should_route_hook_t __rcu *br_should_route_hook; +extern int br_multicast_list_adjacent (struct net_device *net_dev, +struct list_head *br_ip_list);#endif
net/bridge/br_multicast.c +59 -0
68 lines not on this page · raw message
net/bridge/br_private.h +0 -11
@@ -52,17 +52,6 @@ struct mac_addrunsigned char addr[6 ]; }; -struct br_ip -{ -union { -__be32 ip4; -#if IS_ENABLED (CONFIG_IPV6 ) -struct in6_addr ip6; -#endif - } u; -__be16 proto; -}; -struct net_bridge_fdb_entry {struct hlist_node hlist;
Signature · 1 line
1.7.10.4