Skip to contentSkip to conversation

netfilter: nf_tables: fix nf_log_trace based tracing

PATCH Applied Florian Westphal 2 participants 2 messages Dec 9, 2015 – Dec 10, 2015

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: nf_tables: fix nf_log_trace based tracing

nf_log_trace() outputs bogus 'TRACE:' strings because I forgot to update the comments array.

Fixes 33d5a7b14bfd0 ("netfilter: nf_tables: extend tracing infrastructure")

---

net/netfilter/nf_tables_core.c +5 -11
index 67fa41d..e9f8dff 100644
@@ -23,16 +23,10 @@
 #include <net/netfilter/nf_tables.h>
 #include <net/netfilter/nf_log.h>
 
-enum nft_trace {
-	NFT_TRACE_RULE,
-	NFT_TRACE_RETURN,
-	NFT_TRACE_POLICY,
-};
-
-static const char *const comments[] = {
-	[NFT_TRACE_RULE]	= "rule",
-	[NFT_TRACE_RETURN]	= "return",
-	[NFT_TRACE_POLICY]	= "policy",
+static const char *const comments[__NFT_TRACETYPE_MAX] = {
+	[NFT_TRACETYPE_POLICY]	= "policy",
+	[NFT_TRACETYPE_RETURN]	= "return",
+	[NFT_TRACETYPE_RULE]	= "rule",
 };
 
 static struct nf_loginfo trace_loginfo = {
@@ -47,7 +41,7 @@ static struct nf_loginfo trace_loginfo = {
 
 static noinline void __nft_trace_packet(struct nft_traceinfo *info,
 					const struct nft_chain *chain,
-					int rulenum, enum nft_trace type)
+					int rulenum, enum nft_trace_types type)
 {
 	const struct nft_pktinfo *pkt = info->pkt;
 
Signature · 1 line
2.4.10
maintainer Applied
#1 lore raw
Quoted 4 lines · Florian Westphal

nf_log_trace() outputs bogus 'TRACE:' strings because I forgot to update the comments array.

Fixes 33d5a7b14bfd0 ("netfilter: nf_tables: extend tracing infrastructure")

Applied to nf-next, thanks Florian.