net: fix build without CONFIG_SYSCTL definition
Subsystems (2)
PATCH 1/1 net: fix build without CONFIG_SYSCTL definition
Earlier commit 316cdaa1158a ("net: add option to not create fall-back tunnels in root-ns as well") removed the CONFIG_SYSCTL to enable the kernel-commandline to work. However, this variable gets defined only when CONFIG_SYSCTL option is selected.
With this change the behavior would default to creating fall-back tunnels in all namespaces when CONFIG_SYSCTL is not selected and the kernel commandline option will be ignored.
--- include/linux/netdevice.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
include/linux/netdevice.h +3 -2
@@ -634,8 +634,9 @@ extern int sysctl_devconf_inherit_init_net;*/ static inline bool net_has_fallback_tunnels (const struct net *net) { -return (net == &init_net && sysctl_fb_tunnels_only_for_init_net ==1 ) || - !sysctl_fb_tunnels_only_for_init_net; +return !IS_ENABLED (CONFIG_SYSCTL ) || + !sysctl_fb_tunnels_only_for_init_net || + (net == &init_net && sysctl_fb_tunnels_only_for_init_net ==1 ); }static inline int netdev_queue_numa_node_read (const struct netdev_queue *q)
Signature · 1 line
2.28.0.681.g6f77f65b4e-goog
Quoted 5 lines · Mahesh Bandewar
Earlier commit
316cdaa1158a("net: add option to not create fall-back tunnels in root-ns as well") removed theCONFIG_SYSCTLto enable the kernel-commandline to work. However, this variable gets defined only whenCONFIG_SYSCTLoption is selected.
Quoted 8 lines
With this change the behavior would default to creating fall-back tunnels in all namespaces when
CONFIG_SYSCTLis not selected and the kernel commandline option will be ignored.Fixes 316cdaa1158a ("net: add option to not create fall-back tunnels in root-ns as well")Signed-off-by Mahesh Bandewar <[email protected]>Reported-by Randy Dunlap <[email protected]>Reported-by kernel test robot <[email protected]>
Thanks.
Quoted 21 lines
--- include/linux/netdevice.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)include/linux/netdevice.h +3
-2@@ -634,8 +634,9 @@ extern int sysctl_devconf_inherit_init_net;*/ static inline bool net_has_fallback_tunnels (const struct net *net) { -return (net == &init_net && sysctl_fb_tunnels_only_for_init_net ==1 ) || - !sysctl_fb_tunnels_only_for_init_net; +return !IS_ENABLED (CONFIG_SYSCTL ) || + !sysctl_fb_tunnels_only_for_init_net || + (net == &init_net && sysctl_fb_tunnels_only_for_init_net ==1 ); }static inline int netdev_queue_numa_node_read (const struct netdev_queue *q)
Signature · 1 line
~Randy
From: Mahesh Bandewar <[email protected]>
Date: Thu, 17 Sep 2020 22:08:32 -0700
Quoted 5 lines
Earlier commit
316cdaa1158a("net: add option to not create fall-back tunnels in root-ns as well") removed theCONFIG_SYSCTLto enable the kernel-commandline to work. However, this variable gets defined only whenCONFIG_SYSCTLoption is selected.
Quoted 8 lines
With this change the behavior would default to creating fall-back tunnels in all namespaces when
CONFIG_SYSCTLis not selected and the kernel commandline option will be ignored.Fixes 316cdaa1158a ("net: add option to not create fall-back tunnels in root-ns as well")Signed-off-by Mahesh Bandewar <[email protected]>Reported-by Randy Dunlap <[email protected]>Reported-by kernel test robot <[email protected]>
Applied.