genmask);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -1581,7 +1489,6 @@ static int nf_tables_newchain(struct net
+@@ -1597,7 +1505,6 @@ static int nf_tables_newchain(struct net
const struct nlattr * uninitialized_var(name);
u8 genmask = nft_genmask_next(net);
int family = nfmsg->nfgen_family;
struct nft_table *table;
struct nft_chain *chain;
u8 policy = NF_ACCEPT;
-@@ -1591,11 +1498,7 @@ static int nf_tables_newchain(struct net
+@@ -1607,11 +1514,7 @@ static int nf_tables_newchain(struct net
create = nlh->nlmsg_flags & NLM_F_CREATE ? true : false;
genmask);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -1636,7 +1539,7 @@ static int nf_tables_newchain(struct net
+@@ -1652,7 +1555,7 @@ static int nf_tables_newchain(struct net
}
}
if (chain != NULL) {
if (nlh->nlmsg_flags & NLM_F_EXCL)
-@@ -1657,7 +1560,6 @@ static int nf_tables_delchain(struct net
+@@ -1673,7 +1576,6 @@ static int nf_tables_delchain(struct net
{
const struct nfgenmsg *nfmsg = nlmsg_data(nlh);
u8 genmask = nft_genmask_next(net);
struct nft_table *table;
struct nft_chain *chain;
struct nft_rule *rule;
-@@ -1666,11 +1568,7 @@ static int nf_tables_delchain(struct net
+@@ -1682,11 +1584,7 @@ static int nf_tables_delchain(struct net
u32 use;
int err;
genmask);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -1683,7 +1581,7 @@ static int nf_tables_delchain(struct net
+@@ -1699,7 +1597,7 @@ static int nf_tables_delchain(struct net
chain->use > 0)
return -EBUSY;
use = chain->use;
list_for_each_entry(rule, &chain->rules, list) {
-@@ -2107,7 +2005,7 @@ static int nf_tables_dump_rules(struct s
+@@ -2123,7 +2021,7 @@ static int nf_tables_dump_rules(struct s
cb->seq = net->nft.base_seq;
list_for_each_entry_rcu(table, &net->nft.tables, list) {
continue;
if (ctx && ctx->table && strcmp(ctx->table, table->name) != 0)
-@@ -2130,7 +2028,7 @@ static int nf_tables_dump_rules(struct s
+@@ -2146,7 +2044,7 @@ static int nf_tables_dump_rules(struct s
cb->nlh->nlmsg_seq,
NFT_MSG_NEWRULE,
NLM_F_MULTI | NLM_F_APPEND,
table, chain, rule) < 0)
goto done;
-@@ -2166,7 +2064,6 @@ static int nf_tables_getrule(struct net
+@@ -2182,7 +2080,6 @@ static int nf_tables_getrule(struct net
{
const struct nfgenmsg *nfmsg = nlmsg_data(nlh);
u8 genmask = nft_genmask_cur(net);
const struct nft_table *table;
const struct nft_chain *chain;
const struct nft_rule *rule;
-@@ -2210,11 +2107,7 @@ static int nf_tables_getrule(struct net
+@@ -2226,11 +2123,7 @@ static int nf_tables_getrule(struct net
return netlink_dump_start(nlsk, skb, nlh, &c);
}
genmask);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -2279,7 +2172,7 @@ static int nf_tables_newrule(struct net
+@@ -2296,7 +2189,7 @@ static int nf_tables_newrule(struct net
{
const struct nfgenmsg *nfmsg = nlmsg_data(nlh);
u8 genmask = nft_genmask_next(net);
struct nft_table *table;
struct nft_chain *chain;
struct nft_rule *rule, *old_rule = NULL;
-@@ -2295,11 +2188,7 @@ static int nf_tables_newrule(struct net
+@@ -2312,11 +2205,7 @@ static int nf_tables_newrule(struct net
create = nlh->nlmsg_flags & NLM_F_CREATE ? true : false;
genmask);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -2339,7 +2228,7 @@ static int nf_tables_newrule(struct net
+@@ -2356,7 +2245,7 @@ static int nf_tables_newrule(struct net
return PTR_ERR(old_rule);
}
n = 0;
size = 0;
-@@ -2468,18 +2357,13 @@ static int nf_tables_delrule(struct net
+@@ -2478,18 +2367,13 @@ static int nf_tables_delrule(struct net
{
const struct nfgenmsg *nfmsg = nlmsg_data(nlh);
u8 genmask = nft_genmask_next(net);
genmask);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -2491,7 +2375,7 @@ static int nf_tables_delrule(struct net
+@@ -2501,7 +2385,7 @@ static int nf_tables_delrule(struct net
return PTR_ERR(chain);
}
if (chain) {
if (nla[NFTA_RULE_HANDLE]) {
-@@ -2676,26 +2560,17 @@ static int nft_ctx_init_from_setattr(str
+@@ -2686,26 +2570,17 @@ static int nft_ctx_init_from_setattr(str
u8 genmask)
{
const struct nfgenmsg *nfmsg = nlmsg_data(nlh);
return 0;
}
-@@ -2927,7 +2802,7 @@ static int nf_tables_dump_sets(struct sk
+@@ -2937,7 +2812,7 @@ static int nf_tables_dump_sets(struct sk
list_for_each_entry_rcu(table, &net->nft.tables, list) {
if (ctx->family != NFPROTO_UNSPEC &&
continue;
if (ctx->table && ctx->table != table)
-@@ -2948,7 +2823,7 @@ static int nf_tables_dump_sets(struct sk
+@@ -2958,7 +2833,7 @@ static int nf_tables_dump_sets(struct sk
ctx_set = *ctx;
ctx_set.table = table;
if (nf_tables_fill_set(skb, &ctx_set, set,
NFT_MSG_NEWSET,
-@@ -3060,8 +2935,8 @@ static int nf_tables_newset(struct net *
+@@ -3070,8 +2945,8 @@ static int nf_tables_newset(struct net *
{
const struct nfgenmsg *nfmsg = nlmsg_data(nlh);
u8 genmask = nft_genmask_next(net);
struct nft_table *table;
struct nft_set *set;
struct nft_ctx ctx;
-@@ -3168,16 +3043,12 @@ static int nf_tables_newset(struct net *
+@@ -3178,16 +3053,12 @@ static int nf_tables_newset(struct net *
create = nlh->nlmsg_flags & NLM_F_CREATE ? true : false;
set = nf_tables_set_lookup(table, nla[NFTA_SET_NAME], genmask);
if (IS_ERR(set)) {
-@@ -3439,19 +3310,15 @@ static int nft_ctx_init_from_elemattr(st
+@@ -3449,19 +3320,15 @@ static int nft_ctx_init_from_elemattr(st
u8 genmask)
{
const struct nfgenmsg *nfmsg = nlmsg_data(nlh);
return 0;
}
-@@ -3569,7 +3436,7 @@ static int nf_tables_dump_set(struct sk_
+@@ -3579,7 +3446,7 @@ static int nf_tables_dump_set(struct sk_
rcu_read_lock();
list_for_each_entry_rcu(table, &net->nft.tables, list) {
if (dump_ctx->ctx.family != NFPROTO_UNSPEC &&
continue;
if (table != dump_ctx->ctx.table)
-@@ -3599,7 +3466,7 @@ static int nf_tables_dump_set(struct sk_
+@@ -3609,7 +3476,7 @@ static int nf_tables_dump_set(struct sk_
goto nla_put_failure;
nfmsg = nlmsg_data(nlh);
nfmsg->version = NFNETLINK_V0;
nfmsg->res_id = htons(net->nft.base_seq & 0xffff);
-@@ -4478,7 +4345,6 @@ static int nf_tables_newobj(struct net *
+@@ -4489,7 +4356,6 @@ static int nf_tables_newobj(struct net *
const struct nft_object_type *type;
u8 genmask = nft_genmask_next(net);
int family = nfmsg->nfgen_family;
struct nft_table *table;
struct nft_object *obj;
struct nft_ctx ctx;
-@@ -4490,11 +4356,7 @@ static int nf_tables_newobj(struct net *
+@@ -4501,11 +4367,7 @@ static int nf_tables_newobj(struct net *
!nla[NFTA_OBJ_DATA])
return -EINVAL;
genmask);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -4513,7 +4375,7 @@ static int nf_tables_newobj(struct net *
+@@ -4524,7 +4386,7 @@ static int nf_tables_newobj(struct net *
return 0;
}
type = nft_obj_type_get(objtype);
if (IS_ERR(type))
-@@ -4605,7 +4467,7 @@ static int nf_tables_dump_obj(struct sk_
+@@ -4616,7 +4478,7 @@ static int nf_tables_dump_obj(struct sk_
cb->seq = net->nft.base_seq;
list_for_each_entry_rcu(table, &net->nft.tables, list) {
continue;
list_for_each_entry_rcu(obj, &table->objects, list) {
-@@ -4628,7 +4490,7 @@ static int nf_tables_dump_obj(struct sk_
+@@ -4639,7 +4501,7 @@ static int nf_tables_dump_obj(struct sk_
cb->nlh->nlmsg_seq,
NFT_MSG_NEWOBJ,
NLM_F_MULTI | NLM_F_APPEND,
obj, reset) < 0)
goto done;
-@@ -4686,7 +4548,6 @@ static int nf_tables_getobj(struct net *
+@@ -4697,7 +4559,6 @@ static int nf_tables_getobj(struct net *
const struct nfgenmsg *nfmsg = nlmsg_data(nlh);
u8 genmask = nft_genmask_cur(net);
int family = nfmsg->nfgen_family;
const struct nft_table *table;
struct nft_object *obj;
struct sk_buff *skb2;
-@@ -4717,11 +4578,7 @@ static int nf_tables_getobj(struct net *
+@@ -4728,11 +4589,7 @@ static int nf_tables_getobj(struct net *
!nla[NFTA_OBJ_TYPE])
return -EINVAL;
genmask);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -4768,7 +4625,6 @@ static int nf_tables_delobj(struct net *
+@@ -4779,7 +4636,6 @@ static int nf_tables_delobj(struct net *
const struct nfgenmsg *nfmsg = nlmsg_data(nlh);
u8 genmask = nft_genmask_next(net);
int family = nfmsg->nfgen_family;
struct nft_table *table;
struct nft_object *obj;
struct nft_ctx ctx;
-@@ -4778,11 +4634,7 @@ static int nf_tables_delobj(struct net *
+@@ -4789,11 +4645,7 @@ static int nf_tables_delobj(struct net *
!nla[NFTA_OBJ_NAME])
return -EINVAL;
genmask);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -4794,7 +4646,7 @@ static int nf_tables_delobj(struct net *
+@@ -4805,7 +4657,7 @@ static int nf_tables_delobj(struct net *
if (obj->use > 0)
return -EBUSY;
return nft_delobj(&ctx, obj);
}
-@@ -4979,33 +4831,31 @@ err1:
+@@ -4990,33 +4842,31 @@ err1:
return err;
}
return ERR_PTR(-EAGAIN);
}
#endif
-@@ -5053,7 +4903,6 @@ static int nf_tables_newflowtable(struct
+@@ -5064,7 +4914,6 @@ static int nf_tables_newflowtable(struct
u8 genmask = nft_genmask_next(net);
int family = nfmsg->nfgen_family;
struct nft_flowtable *flowtable;
struct nft_table *table;
struct nft_ctx ctx;
int err, i, k;
-@@ -5063,12 +4912,8 @@ static int nf_tables_newflowtable(struct
+@@ -5074,12 +4923,8 @@ static int nf_tables_newflowtable(struct
!nla[NFTA_FLOWTABLE_HOOK])
return -EINVAL;
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -5085,7 +4930,7 @@ static int nf_tables_newflowtable(struct
+@@ -5096,7 +4941,7 @@ static int nf_tables_newflowtable(struct
return 0;
}
flowtable = kzalloc(sizeof(*flowtable), GFP_KERNEL);
if (!flowtable)
-@@ -5098,7 +4943,7 @@ static int nf_tables_newflowtable(struct
+@@ -5109,7 +4954,7 @@ static int nf_tables_newflowtable(struct
goto err1;
}
if (IS_ERR(type)) {
err = PTR_ERR(type);
goto err2;
-@@ -5158,16 +5003,11 @@ static int nf_tables_delflowtable(struct
+@@ -5169,16 +5014,11 @@ static int nf_tables_delflowtable(struct
u8 genmask = nft_genmask_next(net);
int family = nfmsg->nfgen_family;
struct nft_flowtable *flowtable;
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -5178,7 +5018,7 @@ static int nf_tables_delflowtable(struct
+@@ -5189,7 +5029,7 @@ static int nf_tables_delflowtable(struct
if (flowtable->use > 0)
return -EBUSY;
return nft_delflowtable(&ctx, flowtable);
}
-@@ -5253,7 +5093,7 @@ static int nf_tables_dump_flowtable(stru
+@@ -5264,7 +5104,7 @@ static int nf_tables_dump_flowtable(stru
cb->seq = net->nft.base_seq;
list_for_each_entry_rcu(table, &net->nft.tables, list) {
continue;
list_for_each_entry_rcu(flowtable, &table->flowtables, list) {
-@@ -5272,7 +5112,7 @@ static int nf_tables_dump_flowtable(stru
+@@ -5283,7 +5123,7 @@ static int nf_tables_dump_flowtable(stru
cb->nlh->nlmsg_seq,
NFT_MSG_NEWFLOWTABLE,
NLM_F_MULTI | NLM_F_APPEND,
goto done;
nl_dump_check_consistent(cb, nlmsg_hdr(skb));
-@@ -5332,7 +5172,6 @@ static int nf_tables_getflowtable(struct
+@@ -5343,7 +5183,6 @@ static int nf_tables_getflowtable(struct
u8 genmask = nft_genmask_cur(net);
int family = nfmsg->nfgen_family;
struct nft_flowtable *flowtable;
const struct nft_table *table;
struct sk_buff *skb2;
int err;
-@@ -5358,12 +5197,8 @@ static int nf_tables_getflowtable(struct
+@@ -5369,12 +5208,8 @@ static int nf_tables_getflowtable(struct
if (!nla[NFTA_FLOWTABLE_NAME])
return -EINVAL;
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -6529,7 +6364,7 @@ int __nft_release_basechain(struct nft_c
+@@ -6545,7 +6380,7 @@ int __nft_release_basechain(struct nft_c
}
EXPORT_SYMBOL_GPL(__nft_release_basechain);
{
struct nft_flowtable *flowtable, *nf;
struct nft_table *table, *nt;
-@@ -6542,7 +6377,7 @@ static void __nft_release_afinfo(struct
+@@ -6558,7 +6393,7 @@ static void __nft_release_afinfo(struct
};
list_for_each_entry_safe(table, nt, &net->nft.tables, list) {
list_for_each_entry(chain, &table->chains, list)
nf_tables_unregister_hook(net, table, chain);
-@@ -6594,7 +6429,7 @@ static int __net_init nf_tables_init_net
+@@ -6610,7 +6445,7 @@ static int __net_init nf_tables_init_net
static void __net_exit nf_tables_exit_net(struct net *net)
{