Skip to content

Commit be9fc09

Browse files
arndbdavem330
authored andcommitted
net: fix sysctl_fb_tunnels_only_for_init_net link error
The new variable is only available when CONFIG_SYSCTL is enabled, otherwise we get a link error: net/ipv4/ip_tunnel.o: In function `ip_tunnel_init_net': ip_tunnel.c:(.text+0x278b): undefined reference to `sysctl_fb_tunnels_only_for_init_net' net/ipv6/sit.o: In function `sit_init_net': sit.c:(.init.text+0x4c): undefined reference to `sysctl_fb_tunnels_only_for_init_net' net/ipv6/ip6_tunnel.o: In function `ip6_tnl_init_net': ip6_tunnel.c:(.init.text+0x39): undefined reference to `sysctl_fb_tunnels_only_for_init_net' This adds an extra condition, keeping the traditional behavior when CONFIG_SYSCTL is disabled. Fixes: 79134e6 ("net: do not create fallback tunnels for non-default namespaces") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6056415 commit be9fc09

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/linux/netdevice.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,9 @@ extern int sysctl_fb_tunnels_only_for_init_net;
589589

590590
static inline bool net_has_fallback_tunnels(const struct net *net)
591591
{
592-
return net == &init_net || !sysctl_fb_tunnels_only_for_init_net;
592+
return net == &init_net ||
593+
!IS_ENABLED(CONFIG_SYSCTL) ||
594+
!sysctl_fb_tunnels_only_for_init_net;
593595
}
594596

595597
static inline int netdev_queue_numa_node_read(const struct netdev_queue *q)

0 commit comments

Comments
 (0)