All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH nf-next] nfilter: nf_hooks: fix build failure with NF_TABLES=n
Date: Tue, 8 Jun 2021 17:46:46 +0200	[thread overview]
Message-ID: <20210608154646.GA983@salvia> (raw)
In-Reply-To: <20210608144237.5813-1-fw@strlen.de>

Maybe from Kconfig, select CONFIG_NF_TABLES from NFNETLINK_HOOK to
reduce ifdef pollution?

On Tue, Jun 08, 2021 at 04:42:37PM +0200, Florian Westphal wrote:
> nfnetlink_hook.c: In function 'nfnl_hook_put_nft_chain_info':
> nfnetlink_hook.c:76:7: error: implicit declaration of 'nft_is_active'
> 
> This macro is only defined when NF_TABLES is enabled.
> Add IS_ENABLED guards for this.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: 252956528caa ("netfilter: add new hook nfnl subsystem")
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
>  net/netfilter/nfnetlink_hook.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/net/netfilter/nfnetlink_hook.c b/net/netfilter/nfnetlink_hook.c
> index 04586dfa2acd..d624805e977c 100644
> --- a/net/netfilter/nfnetlink_hook.c
> +++ b/net/netfilter/nfnetlink_hook.c
> @@ -61,6 +61,7 @@ static int nfnl_hook_put_nft_chain_info(struct sk_buff *nlskb,
>  					unsigned int seq,
>  					const struct nf_hook_ops *ops)
>  {
> +#if IS_ENABLED(CONFIG_NF_TABLES)
>  	struct net *net = sock_net(nlskb->sk);
>  	struct nlattr *nest, *nest2;
>  	struct nft_chain *chain;
> @@ -104,6 +105,9 @@ static int nfnl_hook_put_nft_chain_info(struct sk_buff *nlskb,
>  cancel_nest:
>  	nla_nest_cancel(nlskb, nest);
>  	return -EMSGSIZE;
> +#else
> +	return 0;
> +#endif
>  }
>  
>  static int nfnl_hook_dump_one(struct sk_buff *nlskb,
> -- 
> 2.31.1
> 

  reply	other threads:[~2021-06-08 15:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 13:43 [linux-next:master 7125/8019] net/netfilter/nfnetlink_hook.c:76:7: error: implicit declaration of function 'nft_is_active' kernel test robot
2021-06-08 13:43 ` kernel test robot
2021-06-08 14:42 ` [PATCH nf-next] nfilter: nf_hooks: fix build failure with NF_TABLES=n Florian Westphal
2021-06-08 15:46   ` Pablo Neira Ayuso [this message]
2021-06-08 15:53     ` Florian Westphal
2021-06-08 16:03       ` Pablo Neira Ayuso
2021-06-08 20:11         ` Florian Westphal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210608154646.GA983@salvia \
    --to=pablo@netfilter.org \
    --cc=fw@strlen.de \
    --cc=lkp@intel.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.