diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-05-15 11:18:26 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-05-15 13:44:20 -0400 |
commit | 3b084e99a3fabaeb0f9c65a0806cde30f0b2835e (patch) | |
tree | 5125063b91417a8a74967ea4469fdde1bf4f2e89 | |
parent | 7e9bc10db275b22a9db0f976b33b5aeed288da73 (diff) |
netfilter: nf_tables: fix trace of matching non-terminal rule
Add the corresponding trace if we have a full match in a non-terminal
rule. Note that the traces will look slightly different than in
x_tables since the log message after all expressions have been
evaluated (contrary to x_tables, that emits it before the target
action). This manifests in two differences in nf_tables wrt. x_tables:
1) The rule that enables the tracing is included in the trace.
2) If the rule emits some log message, that is shown before the
trace log message.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | net/netfilter/nf_tables_core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/netfilter/nf_tables_core.c b/net/netfilter/nf_tables_core.c index 421c36ac5145..345acfb1720b 100644 --- a/net/netfilter/nf_tables_core.c +++ b/net/netfilter/nf_tables_core.c | |||
@@ -144,8 +144,10 @@ next_rule: | |||
144 | switch (data[NFT_REG_VERDICT].verdict) { | 144 | switch (data[NFT_REG_VERDICT].verdict) { |
145 | case NFT_BREAK: | 145 | case NFT_BREAK: |
146 | data[NFT_REG_VERDICT].verdict = NFT_CONTINUE; | 146 | data[NFT_REG_VERDICT].verdict = NFT_CONTINUE; |
147 | /* fall through */ | 147 | continue; |
148 | case NFT_CONTINUE: | 148 | case NFT_CONTINUE: |
149 | if (unlikely(pkt->skb->nf_trace)) | ||
150 | nft_trace_packet(pkt, chain, rulenum, NFT_TRACE_RULE); | ||
149 | continue; | 151 | continue; |
150 | } | 152 | } |
151 | break; | 153 | break; |