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

netfilter: nf_tables: fix bogus rulenum after goto action

After returning from the chain that we just went to with no matchings,
we get a bogus rule number in the trace. To fix this, we would need
to iterate over the list of remaining rules in the chain to update the
rule number counter.

Patrick suggested to set this to the maximum value since the default
base chain policy is the very last action when the processing the base
chain is over.
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 7b9d5ef9
......@@ -202,7 +202,7 @@ nft_do_chain(struct nft_pktinfo *pkt, const struct nf_hook_ops *ops)
}
if (unlikely(pkt->skb->nf_trace))
nft_trace_packet(pkt, basechain, ++rulenum, NFT_TRACE_POLICY);
nft_trace_packet(pkt, basechain, -1, NFT_TRACE_POLICY);
rcu_read_lock_bh();
stats = rcu_dereference(nft_base_chain(basechain)->stats);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册