From: Florian Westphal <fw@strlen.de>
To: <netfilter-devel@vger.kernel.org>
Cc: Florian Westphal <fw@strlen.de>, kernel test robot <lkp@intel.com>
Subject: [PATCH nf-next] nfilter: nf_hooks: fix build failure with NF_TABLES=n
Date: Tue, 8 Jun 2021 16:42:37 +0200 [thread overview]
Message-ID: <20210608144237.5813-1-fw@strlen.de> (raw)
In-Reply-To: <202106082146.9TmnLWJk-lkp@intel.com>
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
next parent reply other threads:[~2021-06-08 14:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <202106082146.9TmnLWJk-lkp@intel.com>
2021-06-08 14:42 ` Florian Westphal [this message]
2021-06-08 15:46 ` [PATCH nf-next] nfilter: nf_hooks: fix build failure with NF_TABLES=n Pablo Neira Ayuso
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=20210608144237.5813-1-fw@strlen.de \
--to=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 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).