Commit 30515832 authored by Matteo Croce's avatar Matteo Croce Committed by David S. Miller

net: bridge: fix build when IPv6 is disabled

The br_ip6_multicast_add_router() prototype is defined only when
CONFIG_IPV6 is enabled, but the function is always referenced, so there
is this build error with CONFIG_IPV6 not defined:

net/bridge/br_multicast.c: In function ‘__br_multicast_enable_port’:
net/bridge/br_multicast.c:1743:3: error: implicit declaration of function ‘br_ip6_multicast_add_router’; did you mean ‘br_ip4_multicast_add_router’? [-Werror=implicit-function-declaration]
 1743 |   br_ip6_multicast_add_router(br, port);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |   br_ip4_multicast_add_router
net/bridge/br_multicast.c: At top level:
net/bridge/br_multicast.c:2804:13: warning: conflicting types for ‘br_ip6_multicast_add_router’
 2804 | static void br_ip6_multicast_add_router(struct net_bridge *br,
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
net/bridge/br_multicast.c:2804:13: error: static declaration of ‘br_ip6_multicast_add_router’ follows non-static declaration
net/bridge/br_multicast.c:1743:3: note: previous implicit declaration of ‘br_ip6_multicast_add_router’ was here
 1743 |   br_ip6_multicast_add_router(br, port);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix this build error by moving the definition out of the #ifdef.

Fixes: a3c02e76 ("net: bridge: mcast: split multicast router state for IPv4 and IPv6")
Signed-off-by: default avatarMatteo Croce <mcroce@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bbc6f2cc
...@@ -62,9 +62,9 @@ static void br_multicast_port_group_rexmit(struct timer_list *t); ...@@ -62,9 +62,9 @@ static void br_multicast_port_group_rexmit(struct timer_list *t);
static void static void
br_multicast_rport_del_notify(struct net_bridge_port *p, bool deleted); br_multicast_rport_del_notify(struct net_bridge_port *p, bool deleted);
#if IS_ENABLED(CONFIG_IPV6)
static void br_ip6_multicast_add_router(struct net_bridge *br, static void br_ip6_multicast_add_router(struct net_bridge *br,
struct net_bridge_port *port); struct net_bridge_port *port);
#if IS_ENABLED(CONFIG_IPV6)
static void br_ip6_multicast_leave_group(struct net_bridge *br, static void br_ip6_multicast_leave_group(struct net_bridge *br,
struct net_bridge_port *port, struct net_bridge_port *port,
const struct in6_addr *group, const struct in6_addr *group,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment