Skip to content

Commit 5f9bfe0

Browse files
committed
netfilter: nf_tables: do not dump chain counters if not enabled
Chain counters are only enabled on demand since 9f08ea8, skip them when dumping them via netlink. Fixes: 9f08ea8 ("netfilter: nf_tables: keep chain counters away from hot path") Reported-by: Johny Mattsson <johny.mattsson+kernel@gmail.com> Tested-by: Johny Mattsson <johny.mattsson+kernel@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent e63aaaa commit 5f9bfe0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ static int nf_tables_fill_chain_info(struct sk_buff *skb, struct net *net,
10481048
if (nla_put_string(skb, NFTA_CHAIN_TYPE, basechain->type->name))
10491049
goto nla_put_failure;
10501050

1051-
if (nft_dump_stats(skb, nft_base_chain(chain)->stats))
1051+
if (basechain->stats && nft_dump_stats(skb, basechain->stats))
10521052
goto nla_put_failure;
10531053
}
10541054

0 commit comments

Comments
 (0)