netfilter: nft_ct: define nft_ct_get_eval_counter() only when needed
Subsystems (3)
PATCH 1/1 netfilter: nft_ct: define nft_ct_get_eval_counter() only when needed
This eliminates an "unused function" compiler warning when CONFIG_NF_CONNTRACK_LABELS is not defined.
Signed-off-by Eric Biggers <[email protected]>
--- net/netfilter/nft_ct.c | 2 ++ 1 file changed, 2 insertions(+)
net/netfilter/nft_ct.c +2 -0
@@ -31,6 +31,7 @@ struct nft_ct { }; }; +#ifdef CONFIG_NF_CONNTRACK_LABELS static u64 nft_ct_get_eval_counter (const struct nf_conn_counter *c,enum nft_ct_keys k,enum ip_conntrack_dir d)
@@ -42,6 +43,7 @@ static u64 nft_ct_get_eval_counter(const struct nf_conn_counter *c,return nft_ct_get_eval_counter (c, k,IP_CT_DIR_ORIGINAL ) +nft_ct_get_eval_counter (c, k,IP_CT_DIR_REPLY ); } +#endif static void nft_ct_get_eval(const struct nft_expr *expr, struct nft_regs *regs,
Signature · 1 line
2.7.0
Florian Westphal
maintainerQuoted 4 lines · Eric Biggers
This eliminates an "unused function" compiler warning when
CONFIG_NF_CONNTRACK_LABELSis not defined.Signed-off-by Eric Biggers <[email protected]>
The nft_ct_get_eval_counter call should've been unconditional. The #endif placement is wrong: