netfilter: nf_tables: fix nf_log_trace based tracing
authorFlorian Westphal <fw@strlen.de>
Wed, 9 Dec 2015 15:31:21 +0000 (16:31 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 9 Dec 2015 15:53:46 +0000 (16:53 +0100)
nf_log_trace() outputs bogus 'TRACE:' strings because I forgot to update
the comments array.

Fixes: 33d5a7b14bfd0 ("netfilter: nf_tables: extend tracing infrastructure")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_core.c

index 67fa41d317f6e7fe82ee1f88bfdd139a958facad..e9f8dffcc244573e0fe209a9f03318f2bc53968d 100644 (file)
 #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;