* [PATCH next] net: fix build without CONFIG_SYSCTL definition
@ 2020-09-18 5:08 Mahesh Bandewar
2020-09-18 5:24 ` Randy Dunlap
2020-09-18 21:14 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Mahesh Bandewar @ 2020-09-18 5:08 UTC (permalink / raw)
To: Netdev
Cc: David Miller, Jakub Kicinski, Mahesh Bandewar, Mahesh Bandewar,
Randy Dunlap, kernel test robot
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.
Fixes: 316cdaa1158a ("net: add option to not create fall-back tunnels in root-ns as well")
Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
---
include/linux/netdevice.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 909b1fbb0481..fef0eb96cf69 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -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)
--
2.28.0.681.g6f77f65b4e-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH next] net: fix build without CONFIG_SYSCTL definition
2020-09-18 5:08 [PATCH next] net: fix build without CONFIG_SYSCTL definition Mahesh Bandewar
@ 2020-09-18 5:24 ` Randy Dunlap
2020-09-18 21:14 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2020-09-18 5:24 UTC (permalink / raw)
To: Mahesh Bandewar, Netdev
Cc: David Miller, Jakub Kicinski, Mahesh Bandewar, kernel test robot
On 9/17/20 10:08 PM, Mahesh Bandewar wrote:
> 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.
>
> Fixes: 316cdaa1158a ("net: add option to not create fall-back tunnels in root-ns as well")
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: kernel test robot <lkp@intel.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Thanks.
> ---
> include/linux/netdevice.h | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 909b1fbb0481..fef0eb96cf69 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -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)
>
--
~Randy
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH next] net: fix build without CONFIG_SYSCTL definition
2020-09-18 5:08 [PATCH next] net: fix build without CONFIG_SYSCTL definition Mahesh Bandewar
2020-09-18 5:24 ` Randy Dunlap
@ 2020-09-18 21:14 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-09-18 21:14 UTC (permalink / raw)
To: maheshb; +Cc: netdev, kuba, mahesh, rdunlap, lkp
From: Mahesh Bandewar <maheshb@google.com>
Date: Thu, 17 Sep 2020 22:08:32 -0700
> 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.
>
> Fixes: 316cdaa1158a ("net: add option to not create fall-back tunnels in root-ns as well")
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: kernel test robot <lkp@intel.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-18 21:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-18 5:08 [PATCH next] net: fix build without CONFIG_SYSCTL definition Mahesh Bandewar
2020-09-18 5:24 ` Randy Dunlap
2020-09-18 21:14 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox