Skip to contentSkip to conversation

bridge: Add export of multicast database adjacent to net_dev

RFC PATCH New Linus Lüssing 1 participant 1 message Feb 3, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

---
 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
index 1085ffe..86d71a8 100644
@@ -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
index 711094a..edf3fd8 100644
@@ -52,17 +52,6 @@ struct mac_addr
 	unsigned 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