提交 5f9bfe0e 编写于 作者: P Pablo Neira Ayuso

netfilter: nf_tables: do not dump chain counters if not enabled

Chain counters are only enabled on demand since 9f08ea84, skip them
when dumping them via netlink.

Fixes: 9f08ea84 ("netfilter: nf_tables: keep chain counters away from hot path")
Reported-by: NJohny Mattsson <johny.mattsson+kernel@gmail.com>
Tested-by: NJohny Mattsson <johny.mattsson+kernel@gmail.com>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 e63aaaa6
...@@ -1048,7 +1048,7 @@ static int nf_tables_fill_chain_info(struct sk_buff *skb, struct net *net, ...@@ -1048,7 +1048,7 @@ static int nf_tables_fill_chain_info(struct sk_buff *skb, struct net *net,
if (nla_put_string(skb, NFTA_CHAIN_TYPE, basechain->type->name)) if (nla_put_string(skb, NFTA_CHAIN_TYPE, basechain->type->name))
goto nla_put_failure; goto nla_put_failure;
if (nft_dump_stats(skb, nft_base_chain(chain)->stats)) if (basechain->stats && nft_dump_stats(skb, basechain->stats))
goto nla_put_failure; goto nla_put_failure;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册