[net-next,1/2] bridge: adding stubs for multicast exports

Message ID 1404704477-19448-2-git-send-email-linus.luessing@web.de (mailing list archive)
State Not Applicable, archived
Headers

Commit Message

Linus Lüssing July 7, 2014, 3:41 a.m. UTC
  To make users (e.g. batman-adv soon) load- and runnable even if the
bridge was compiled without snooping capabilities - or even if the
kernel was compiled without any bridge code at all.

Signed-off-by: Linus Lüssing <linus.luessing@web.de>
---
 include/linux/if_bridge.h |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
  

Comments

Cong Wang July 8, 2014, 6:41 p.m. UTC | #1
On Sun, Jul 6, 2014 at 8:41 PM, Linus Lüssing <linus.luessing@web.de> wrote:
> diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
> index fd22789..e0c575c 100644
> --- a/include/linux/if_bridge.h
> +++ b/include/linux/if_bridge.h
> @@ -36,8 +36,22 @@ extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __use
>
>  typedef int br_should_route_hook_t(struct sk_buff *skb);
>  extern br_should_route_hook_t __rcu *br_should_route_hook;
> +
> +#if IS_ENABLED(CONFIG_BRIDGE) && IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING)

Nit: CONFIG_BRIDGE_IGMP_SNOOPING depends CONFIG_BRIDGE,
so you can just check CONFIG_BRIDGE_IGMP_SNOOPING.
  

Patch

diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index fd22789..e0c575c 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -36,8 +36,22 @@  extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __use
 
 typedef int br_should_route_hook_t(struct sk_buff *skb);
 extern br_should_route_hook_t __rcu *br_should_route_hook;
+
+#if IS_ENABLED(CONFIG_BRIDGE) && IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING)
 int br_multicast_list_adjacent(struct net_device *dev,
 			       struct list_head *br_ip_list);
 bool br_multicast_has_querier_adjacent(struct net_device *dev, int proto);
+#else
+static inline int br_multicast_list_adjacent(struct net_device *dev,
+					     struct list_head *br_ip_list)
+{
+	return 0;
+}
+static inline bool br_multicast_has_querier_adjacent(struct net_device *dev,
+						     int proto)
+{
+	return false;
+}
+#endif
 
 #endif