Linux Netfilter development
 help / color / mirror / Atom feed
* Re: [PATCH] netfilter: fix undefined reference to 'netfilter_lwtunnel_*' when CONFIG_SYSCTL=n
       [not found] <24ac3144-c6bc-4fd9-b592-d1a88505e65a@163.com>
@ 2024-06-21 11:43 ` Pablo Neira Ayuso
  0 siblings, 0 replies; only message in thread
From: Pablo Neira Ayuso @ 2024-06-21 11:43 UTC (permalink / raw)
  To: Jianguo Wu; +Cc: LKML, netfilter-devel

Cc'ing netfilter-devel

On Fri, Jun 21, 2024 at 10:41:13AM +0800, Jianguo Wu wrote:
> From: Jianguo Wu <wujianguo@chinatelecom.cn>
> 
> if CONFIG_SYSFS is not enabled in config, we get the below compile error,
> 
> All errors (new ones prefixed by >>):
> 
>    csky-linux-ld: net/netfilter/core.o: in function `netfilter_init':
>    core.c:(.init.text+0x42): undefined reference to `netfilter_lwtunnel_init'
> >> csky-linux-ld: core.c:(.init.text+0x56): undefined reference to `netfilter_lwtunnel_fini'
> >> csky-linux-ld: core.c:(.init.text+0x70): undefined reference to `netfilter_lwtunnel_init'
>    csky-linux-ld: core.c:(.init.text+0x78): undefined reference to `netfilter_lwtunnel_fini'
> 
> Fixes: a2225e0250c5 ("netfilter: move the sysctl nf_hooks_lwtunnel into the netfilter core")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202406210511.8vbByYj3-lkp@intel.com/
> Closes: https://lore.kernel.org/oe-kbuild-all/202406210520.6HmrUaA2-lkp@intel.com/
> Signed-off-by: Jianguo Wu <wujianguo@chinatelecom.cn>
> ---
>  net/netfilter/nf_hooks_lwtunnel.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/netfilter/nf_hooks_lwtunnel.c b/net/netfilter/nf_hooks_lwtunnel.c
> index 7cdb59bb4459..d8ebebc9775d 100644
> --- a/net/netfilter/nf_hooks_lwtunnel.c
> +++ b/net/netfilter/nf_hooks_lwtunnel.c
> @@ -117,4 +117,7 @@ void netfilter_lwtunnel_fini(void)
>  {
>  	unregister_pernet_subsys(&nf_lwtunnel_net_ops);
>  }
> +#else
> +int __init netfilter_lwtunnel_init(void) { return 0; }
> +void netfilter_lwtunnel_fini(void) {}
>  #endif /* CONFIG_SYSCTL */
> -- 
> 1.8.3.1
> 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-06-21 11:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <24ac3144-c6bc-4fd9-b592-d1a88505e65a@163.com>
2024-06-21 11:43 ` [PATCH] netfilter: fix undefined reference to 'netfilter_lwtunnel_*' when CONFIG_SYSCTL=n Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox