diff mbox series

[3/7] netfilter: nf_tables: selective rule dump needs table to be specified

Message ID 20190114212940.5704-4-pablo@netfilter.org
State Accepted
Delegated to: Pablo Neira
Headers show
Series [1/7] netfilter: nf_tables: Fix for endless loop when dumping ruleset | expand

Commit Message

Pablo Neira Ayuso Jan. 14, 2019, 9:29 p.m. UTC
Table needs to be specified for selective rule dumps per chain.

Fixes: 241faeceb849c ("netfilter: nf_tables: Speed up selective rule dumps")
Reported-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/nf_tables_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index dcea979423bc..fb07f6cfc719 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2350,7 +2350,7 @@  static int nf_tables_dump_rules(struct sk_buff *skb,
 		if (ctx && ctx->table && strcmp(ctx->table, table->name) != 0)
 			continue;
 
-		if (ctx && ctx->chain) {
+		if (ctx && ctx->table && ctx->chain) {
 			struct rhlist_head *list, *tmp;
 
 			list = rhltable_lookup(&table->chains_ht, ctx->chain,