diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/nf_tables_api.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index f93b7d06f4be..d9fcd279942f 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c | |||
@@ -2098,17 +2098,21 @@ static int nf_tables_dump_sets_all(struct nft_ctx *ctx, struct sk_buff *skb, | |||
2098 | struct netlink_callback *cb) | 2098 | struct netlink_callback *cb) |
2099 | { | 2099 | { |
2100 | const struct nft_set *set; | 2100 | const struct nft_set *set; |
2101 | unsigned int idx = 0, s_idx = cb->args[0]; | 2101 | unsigned int idx, s_idx = cb->args[0]; |
2102 | struct nft_table *table, *cur_table = (struct nft_table *)cb->args[2]; | 2102 | struct nft_table *table, *cur_table = (struct nft_table *)cb->args[2]; |
2103 | 2103 | ||
2104 | if (cb->args[1]) | 2104 | if (cb->args[1]) |
2105 | return skb->len; | 2105 | return skb->len; |
2106 | 2106 | ||
2107 | list_for_each_entry(table, &ctx->afi->tables, list) { | 2107 | list_for_each_entry(table, &ctx->afi->tables, list) { |
2108 | if (cur_table && cur_table != table) | 2108 | if (cur_table) { |
2109 | continue; | 2109 | if (cur_table != table) |
2110 | continue; | ||
2110 | 2111 | ||
2112 | cur_table = NULL; | ||
2113 | } | ||
2111 | ctx->table = table; | 2114 | ctx->table = table; |
2115 | idx = 0; | ||
2112 | list_for_each_entry(set, &ctx->table->sets, list) { | 2116 | list_for_each_entry(set, &ctx->table->sets, list) { |
2113 | if (idx < s_idx) | 2117 | if (idx < s_idx) |
2114 | goto cont; | 2118 | goto cont; |