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@xxxxxxxxx> Fixes: 252956528caa ("netfilter: add new hook nfnl subsystem") Signed-off-by: Florian Westphal <fw@xxxxxxxxx> --- 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