linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: fix sysctl_fb_tunnels_only_for_init_net link error
@ 2018-03-13 11:44 Arnd Bergmann
  2018-03-13 18:15 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-03-13 11:44 UTC (permalink / raw)
  To: David S. Miller
  Cc: Eric Dumazet, Arnd Bergmann, Jiri Pirko, Daniel Borkmann,
	Jakub Kicinski, netdev, linux-kernel

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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/netdevice.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 5fbb9f1da7fd..913b1cc882cf 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -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)
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: fix sysctl_fb_tunnels_only_for_init_net link error
  2018-03-13 11:44 [PATCH net-next] net: fix sysctl_fb_tunnels_only_for_init_net link error Arnd Bergmann
@ 2018-03-13 18:15 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-03-13 18:15 UTC (permalink / raw)
  To: arnd; +Cc: edumazet, jiri, daniel, jakub.kicinski, netdev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 13 Mar 2018 12:44:53 +0100

> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-13 18:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-13 11:44 [PATCH net-next] net: fix sysctl_fb_tunnels_only_for_init_net link error Arnd Bergmann
2018-03-13 18:15 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).