- if (family != NFPROTO_UNSPEC && family != afi->family)
+ list_for_each_entry_rcu(table, &net->nft.tables, list) {
+ if (family != NFPROTO_UNSPEC && family != table->afi->family)
++ continue;
++
++ if (ctx && ctx->table && strcmp(ctx->table, table->name) != 0)
continue;
- list_for_each_entry_rcu(table, &afi->tables, list) {
- if (ctx && ctx->table &&
- strcmp(ctx->table, table->name) != 0)
-- continue;
-+ if (ctx && ctx->table && strcmp(ctx->table, table->name) != 0)
-+ continue;
++ list_for_each_entry_rcu(chain, &table->chains, list) {
++ if (ctx && ctx->chain &&
++ strcmp(ctx->chain, chain->name) != 0)
+ continue;
- list_for_each_entry_rcu(chain, &table->chains, list) {
- if (ctx && ctx->chain &&
- strcmp(ctx->chain, chain->name) != 0)
- continue;
-+ list_for_each_entry_rcu(chain, &table->chains, list) {
-+ if (ctx && ctx->chain &&
-+ strcmp(ctx->chain, chain->name) != 0)
-+ continue;
-
+-
- list_for_each_entry_rcu(rule, &chain->rules, list) {
- if (!nft_is_active(net, rule))
- goto cont;
- if (cur_family) {
- if (afi->family != cur_family)
+- continue;
+ if (ctx->table && ctx->table != table)
+ continue;
-+
+
+- cur_family = 0;
+- }
+- list_for_each_entry_rcu(table, &afi->tables, list) {
+- if (ctx->table && ctx->table != table)
+ if (cur_table) {
+ if (cur_table != table)
continue;
-- cur_family = 0;
+- if (cur_table) {
+- if (cur_table != table)
+- continue;
+ cur_table = NULL;
- }
-- list_for_each_entry_rcu(table, &afi->tables, list) {
-- if (ctx->table && ctx->table != table)
-- continue;
++ }
+ idx = 0;
+ list_for_each_entry_rcu(set, &table->sets, list) {
+ if (idx < s_idx)
+ if (!nft_is_active(net, set))
+ goto cont;
-- if (cur_table) {
-- if (cur_table != table)
-- continue;
+- cur_table = NULL;
+ ctx_set = *ctx;
+ ctx_set.table = table;
+ ctx_set.family = table->afi->family;
-
-- cur_table = NULL;
++
+ if (nf_tables_fill_set(skb, &ctx_set, set,
+ NFT_MSG_NEWSET,
+ NLM_F_MULTI) < 0) {
}
}
done:
-@@ -5328,7 +5314,8 @@ static int nf_tables_getflowtable(struct
+@@ -5330,7 +5316,8 @@ static int nf_tables_getflowtable(struct
if (IS_ERR(afi))
return PTR_ERR(afi);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -5371,7 +5358,7 @@ static void nf_tables_flowtable_notify(s
+@@ -5373,7 +5360,7 @@ static void nf_tables_flowtable_notify(s
err = nf_tables_fill_flowtable_info(skb, ctx->net, ctx->portid,
ctx->seq, event, 0,
if (err < 0) {
kfree_skb(skb);
goto err;
-@@ -5449,17 +5436,14 @@ static int nf_tables_flowtable_event(str
+@@ -5451,17 +5438,14 @@ static int nf_tables_flowtable_event(str
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
struct nft_flowtable *flowtable;
struct nft_table *table;
}
}
nfnl_unlock(NFNL_SUBSYS_NFTABLES);
-@@ -6478,6 +6462,7 @@ EXPORT_SYMBOL_GPL(nft_data_dump);
+@@ -6480,6 +6464,7 @@ EXPORT_SYMBOL_GPL(nft_data_dump);
static int __net_init nf_tables_init_net(struct net *net)
{
INIT_LIST_HEAD(&net->nft.af_info);
INIT_LIST_HEAD(&net->nft.commit_list);
net->nft.base_seq = 1;
return 0;
-@@ -6514,10 +6499,10 @@ static void __nft_release_afinfo(struct
+@@ -6516,10 +6501,10 @@ static void __nft_release_afinfo(struct
struct nft_set *set, *ns;
struct nft_ctx ctx = {
.net = net,