Skip to contentSkip to conversation

net: fix sysctl_fb_tunnels_only_for_init_net link error

PATCH Applied Arnd Bergmann 2 participants 2 messages Mar 13, 2018

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

PATCH 1/1 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 79134e6ce2c9 ("net: do not create fallback tunnels for non-default namespaces")
---
 include/linux/netdevice.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
include/linux/netdevice.h +3 -1
index 5fbb9f1da7fd..913b1cc882cf 100644
@@ -589,7 +589,9 @@ extern int sysctl_fb_tunnels_only_for_init_net;
 
 static inline bool net_has_fallback_tunnels(const struct net *net)
 {
-	return net == &init_net || !sysctl_fb_tunnels_only_for_init_net;
+	return net == &init_net ||
+	       !IS_ENABLED(CONFIG_SYSCTL) ||
+	       !sysctl_fb_tunnels_only_for_init_net;
 }
 
 static inline int netdev_queue_numa_node_read(const struct netdev_queue *q)
Signature · 1 line
2.9.0
maintainer Applied
#1 lore raw

From: Arnd Bergmann <[email protected]>
Date: Tue, 13 Mar 2018 12:44:53 +0100

Quoted 10 lines

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'

Quoted 5 lines

This adds an extra condition, keeping the traditional behavior when CONFIG_SYSCTL is disabled.

Fixes 79134e6ce2c9 ("net: do not create fallback tunnels for non-default namespaces")

Applied, thank you.