bool report;
};
-@@ -944,6 +944,7 @@ unsigned int nft_do_chain(struct nft_pkt
+@@ -945,6 +945,7 @@ unsigned int nft_do_chain(struct nft_pkt
* @use: number of chain references to this table
* @flags: table flag (see enum nft_table_flags)
* @genmask: generation mask
* @name: name of the table
*/
struct nft_table {
-@@ -956,6 +957,7 @@ struct nft_table {
+@@ -957,6 +958,7 @@ struct nft_table {
u32 use;
u16 flags:14,
genmask:2;
char *name;
};
-@@ -965,13 +967,11 @@ struct nft_table {
+@@ -966,13 +968,11 @@ struct nft_table {
* @list: used internally
* @family: address family
* @owner: module owner
ctx->table = table;
ctx->chain = chain;
ctx->nla = nla;
-@@ -414,30 +413,31 @@ static int nft_delflowtable(struct nft_c
+@@ -429,30 +428,31 @@ static int nft_delflowtable(struct nft_c
* Tables
*/
if (table != NULL)
return table;
-@@ -536,7 +536,7 @@ static void nf_tables_table_notify(const
+@@ -551,7 +551,7 @@ static void nf_tables_table_notify(const
goto err;
err = nf_tables_fill_table_info(skb, ctx->net, ctx->portid, ctx->seq,
if (err < 0) {
kfree_skb(skb);
goto err;
-@@ -553,7 +553,6 @@ static int nf_tables_dump_tables(struct
+@@ -568,7 +568,6 @@ static int nf_tables_dump_tables(struct
struct netlink_callback *cb)
{
const struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh);
const struct nft_table *table;
unsigned int idx = 0, s_idx = cb->args[0];
struct net *net = sock_net(skb->sk);
-@@ -562,30 +561,27 @@ static int nf_tables_dump_tables(struct
+@@ -577,30 +576,27 @@ static int nf_tables_dump_tables(struct
rcu_read_lock();
cb->seq = net->nft.base_seq;
}
done:
rcu_read_unlock();
-@@ -617,7 +613,8 @@ static int nf_tables_gettable(struct net
+@@ -632,7 +628,8 @@ static int nf_tables_gettable(struct net
if (IS_ERR(afi))
return PTR_ERR(afi);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -748,7 +745,7 @@ static int nf_tables_newtable(struct net
+@@ -763,7 +760,7 @@ static int nf_tables_newtable(struct net
return PTR_ERR(afi);
name = nla[NFTA_TABLE_NAME];
if (IS_ERR(table)) {
if (PTR_ERR(table) != -ENOENT)
return PTR_ERR(table);
-@@ -758,7 +755,7 @@ static int nf_tables_newtable(struct net
+@@ -773,7 +770,7 @@ static int nf_tables_newtable(struct net
if (nlh->nlmsg_flags & NLM_F_REPLACE)
return -EOPNOTSUPP;
return nf_tables_updtable(&ctx);
}
-@@ -785,14 +782,15 @@ static int nf_tables_newtable(struct net
+@@ -800,14 +797,15 @@ static int nf_tables_newtable(struct net
INIT_LIST_HEAD(&table->sets);
INIT_LIST_HEAD(&table->objects);
INIT_LIST_HEAD(&table->flowtables);
return 0;
err4:
kfree(table->name);
-@@ -866,30 +864,28 @@ out:
+@@ -881,30 +879,28 @@ out:
static int nft_flush(struct nft_ctx *ctx, int family)
{
}
out:
return err;
-@@ -907,7 +903,7 @@ static int nf_tables_deltable(struct net
+@@ -922,7 +918,7 @@ static int nf_tables_deltable(struct net
int family = nfmsg->nfgen_family;
struct nft_ctx ctx;
if (family == AF_UNSPEC || nla[NFTA_TABLE_NAME] == NULL)
return nft_flush(&ctx, family);
-@@ -915,7 +911,8 @@ static int nf_tables_deltable(struct net
+@@ -930,7 +926,8 @@ static int nf_tables_deltable(struct net
if (IS_ERR(afi))
return PTR_ERR(afi);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -923,7 +920,7 @@ static int nf_tables_deltable(struct net
+@@ -938,7 +935,7 @@ static int nf_tables_deltable(struct net
table->use > 0)
return -EBUSY;
ctx.table = table;
return nft_flush_table(&ctx);
-@@ -935,7 +932,7 @@ static void nf_tables_table_destroy(stru
+@@ -950,7 +947,7 @@ static void nf_tables_table_destroy(stru
kfree(ctx->table->name);
kfree(ctx->table);
}
int nft_register_chain_type(const struct nf_chain_type *ctype)
-@@ -1136,7 +1133,7 @@ static void nf_tables_chain_notify(const
+@@ -1151,7 +1148,7 @@ static void nf_tables_chain_notify(const
goto err;
err = nf_tables_fill_chain_info(skb, ctx->net, ctx->portid, ctx->seq,
ctx->chain);
if (err < 0) {
kfree_skb(skb);
-@@ -1154,7 +1151,6 @@ static int nf_tables_dump_chains(struct
+@@ -1169,7 +1166,6 @@ static int nf_tables_dump_chains(struct
struct netlink_callback *cb)
{
const struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh);
const struct nft_table *table;
const struct nft_chain *chain;
unsigned int idx = 0, s_idx = cb->args[0];
-@@ -1164,31 +1160,30 @@ static int nf_tables_dump_chains(struct
+@@ -1179,31 +1175,30 @@ static int nf_tables_dump_chains(struct
rcu_read_lock();
cb->seq = net->nft.base_seq;
}
}
done:
-@@ -1222,7 +1217,8 @@ static int nf_tables_getchain(struct net
+@@ -1237,7 +1232,8 @@ static int nf_tables_getchain(struct net
if (IS_ERR(afi))
return PTR_ERR(afi);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -1332,8 +1328,8 @@ struct nft_chain_hook {
+@@ -1347,8 +1343,8 @@ struct nft_chain_hook {
static int nft_chain_parse_hook(struct net *net,
const struct nlattr * const nla[],
{
struct nlattr *ha[NFTA_HOOK_MAX + 1];
const struct nf_chain_type *type;
-@@ -1352,10 +1348,10 @@ static int nft_chain_parse_hook(struct n
+@@ -1367,10 +1363,10 @@ static int nft_chain_parse_hook(struct n
hook->num = ntohl(nla_get_be32(ha[NFTA_HOOK_HOOKNUM]));
hook->priority = ntohl(nla_get_be32(ha[NFTA_HOOK_PRIORITY]));
if (IS_ERR(type))
return PTR_ERR(type);
}
-@@ -1367,7 +1363,7 @@ static int nft_chain_parse_hook(struct n
+@@ -1382,7 +1378,7 @@ static int nft_chain_parse_hook(struct n
hook->type = type;
hook->dev = NULL;
char ifname[IFNAMSIZ];
if (!ha[NFTA_HOOK_DEV]) {
-@@ -1402,7 +1398,6 @@ static int nf_tables_addchain(struct nft
+@@ -1417,7 +1413,6 @@ static int nf_tables_addchain(struct nft
{
const struct nlattr * const *nla = ctx->nla;
struct nft_table *table = ctx->table;
struct nft_base_chain *basechain;
struct nft_stats __percpu *stats;
struct net *net = ctx->net;
-@@ -1416,7 +1411,7 @@ static int nf_tables_addchain(struct nft
+@@ -1431,7 +1426,7 @@ static int nf_tables_addchain(struct nft
struct nft_chain_hook hook;
struct nf_hook_ops *ops;
if (err < 0)
return err;
-@@ -1508,7 +1503,7 @@ static int nf_tables_updchain(struct nft
+@@ -1523,7 +1518,7 @@ static int nf_tables_updchain(struct nft
if (!nft_is_base_chain(chain))
return -EBUSY;
create);
if (err < 0)
return err;
-@@ -1618,7 +1613,8 @@ static int nf_tables_newchain(struct net
+@@ -1633,7 +1628,8 @@ static int nf_tables_newchain(struct net
if (IS_ERR(afi))
return PTR_ERR(afi);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -1658,7 +1654,7 @@ static int nf_tables_newchain(struct net
+@@ -1673,7 +1669,7 @@ static int nf_tables_newchain(struct net
}
}
if (chain != NULL) {
if (nlh->nlmsg_flags & NLM_F_EXCL)
-@@ -1692,7 +1688,8 @@ static int nf_tables_delchain(struct net
+@@ -1707,7 +1703,8 @@ static int nf_tables_delchain(struct net
if (IS_ERR(afi))
return PTR_ERR(afi);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -1704,7 +1701,7 @@ static int nf_tables_delchain(struct net
+@@ -1719,7 +1716,7 @@ static int nf_tables_delchain(struct net
chain->use > 0)
return -EBUSY;
use = chain->use;
list_for_each_entry(rule, &chain->rules, list) {
-@@ -1869,7 +1866,7 @@ static int nf_tables_expr_parse(const st
+@@ -1887,7 +1884,7 @@ static int nf_tables_expr_parse(const st
if (err < 0)
return err;
if (IS_ERR(type))
return PTR_ERR(type);
-@@ -2093,7 +2090,7 @@ static void nf_tables_rule_notify(const
+@@ -2115,7 +2112,7 @@ static void nf_tables_rule_notify(const
goto err;
err = nf_tables_fill_rule_info(skb, ctx->net, ctx->portid, ctx->seq,
ctx->chain, rule);
if (err < 0) {
kfree_skb(skb);
-@@ -2117,7 +2114,6 @@ static int nf_tables_dump_rules(struct s
+@@ -2139,7 +2136,6 @@ static int nf_tables_dump_rules(struct s
{
const struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh);
const struct nft_rule_dump_ctx *ctx = cb->data;
const struct nft_table *table;
const struct nft_chain *chain;
const struct nft_rule *rule;
-@@ -2128,39 +2124,37 @@ static int nf_tables_dump_rules(struct s
+@@ -2150,39 +2146,37 @@ static int nf_tables_dump_rules(struct s
rcu_read_lock();
cb->seq = net->nft.base_seq;
}
}
}
-@@ -2238,7 +2232,8 @@ static int nf_tables_getrule(struct net
+@@ -2260,7 +2254,8 @@ static int nf_tables_getrule(struct net
if (IS_ERR(afi))
return PTR_ERR(afi);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -2323,7 +2318,8 @@ static int nf_tables_newrule(struct net
+@@ -2345,7 +2340,8 @@ static int nf_tables_newrule(struct net
if (IS_ERR(afi))
return PTR_ERR(afi);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -2362,7 +2358,7 @@ static int nf_tables_newrule(struct net
+@@ -2384,7 +2380,7 @@ static int nf_tables_newrule(struct net
return PTR_ERR(old_rule);
}
n = 0;
size = 0;
-@@ -2495,7 +2491,8 @@ static int nf_tables_delrule(struct net
+@@ -2517,7 +2513,8 @@ static int nf_tables_delrule(struct net
if (IS_ERR(afi))
return PTR_ERR(afi);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -2506,7 +2503,7 @@ static int nf_tables_delrule(struct net
+@@ -2528,7 +2525,7 @@ static int nf_tables_delrule(struct net
return PTR_ERR(chain);
}
if (chain) {
if (nla[NFTA_RULE_HANDLE]) {
-@@ -2704,13 +2701,13 @@ static int nft_ctx_init_from_setattr(str
+@@ -2726,13 +2723,13 @@ static int nft_ctx_init_from_setattr(str
if (afi == NULL)
return -EAFNOSUPPORT;
return 0;
}
-@@ -2838,7 +2835,7 @@ static int nf_tables_fill_set(struct sk_
+@@ -2860,7 +2857,7 @@ static int nf_tables_fill_set(struct sk_
goto nla_put_failure;
nfmsg = nlmsg_data(nlh);
nfmsg->version = NFNETLINK_V0;
nfmsg->res_id = htons(ctx->net->nft.base_seq & 0xffff);
-@@ -2930,10 +2927,8 @@ static int nf_tables_dump_sets(struct sk
+@@ -2952,10 +2949,8 @@ static int nf_tables_dump_sets(struct sk
{
const struct nft_set *set;
unsigned int idx, s_idx = cb->args[0];
struct nft_ctx *ctx = cb->data, ctx_set;
if (cb->args[1])
-@@ -2942,51 +2937,44 @@ static int nf_tables_dump_sets(struct sk
+@@ -2964,51 +2959,44 @@ static int nf_tables_dump_sets(struct sk
rcu_read_lock();
cb->seq = net->nft.base_seq;
}
cb->args[1] = 1;
done:
-@@ -3196,11 +3184,12 @@ static int nf_tables_newset(struct net *
+@@ -3221,11 +3209,12 @@ static int nf_tables_newset(struct net *
if (IS_ERR(afi))
return PTR_ERR(afi);
set = nf_tables_set_lookup(table, nla[NFTA_SET_NAME], genmask);
if (IS_ERR(set)) {
-@@ -3469,12 +3458,12 @@ static int nft_ctx_init_from_elemattr(st
+@@ -3494,12 +3483,12 @@ static int nft_ctx_init_from_elemattr(st
if (IS_ERR(afi))
return PTR_ERR(afi);
return 0;
}
-@@ -3579,7 +3568,6 @@ static int nf_tables_dump_set(struct sk_
+@@ -3604,7 +3593,6 @@ static int nf_tables_dump_set(struct sk_
{
struct nft_set_dump_ctx *dump_ctx = cb->data;
struct net *net = sock_net(skb->sk);
struct nft_table *table;
struct nft_set *set;
struct nft_set_dump_args args;
-@@ -3591,21 +3579,19 @@ static int nf_tables_dump_set(struct sk_
+@@ -3616,21 +3604,19 @@ static int nf_tables_dump_set(struct sk_
int event;
rcu_read_lock();
}
break;
}
-@@ -3625,7 +3611,7 @@ static int nf_tables_dump_set(struct sk_
+@@ -3650,7 +3636,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);
-@@ -3727,7 +3713,7 @@ static int nf_tables_fill_setelem_info(s
+@@ -3752,7 +3738,7 @@ static int nf_tables_fill_setelem_info(s
goto nla_put_failure;
nfmsg = nlmsg_data(nlh);
nfmsg->version = NFNETLINK_V0;
nfmsg->res_id = htons(ctx->net->nft.base_seq & 0xffff);
-@@ -3971,7 +3957,7 @@ static int nft_add_set_elem(struct nft_c
+@@ -4002,7 +3988,7 @@ static int nft_add_set_elem(struct nft_c
list_for_each_entry(binding, &set->bindings, list) {
struct nft_ctx bind_ctx = {
.net = ctx->net,
.table = ctx->table,
.chain = (struct nft_chain *)binding->chain,
};
-@@ -4521,7 +4507,8 @@ static int nf_tables_newobj(struct net *
+@@ -4554,7 +4540,8 @@ static int nf_tables_newobj(struct net *
if (IS_ERR(afi))
return PTR_ERR(afi);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -4539,7 +4526,7 @@ static int nf_tables_newobj(struct net *
+@@ -4572,7 +4559,7 @@ static int nf_tables_newobj(struct net *
return 0;
}
type = nft_obj_type_get(objtype);
if (IS_ERR(type))
-@@ -4616,7 +4603,6 @@ struct nft_obj_filter {
+@@ -4649,7 +4636,6 @@ struct nft_obj_filter {
static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb)
{
const struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh);
const struct nft_table *table;
unsigned int idx = 0, s_idx = cb->args[0];
struct nft_obj_filter *filter = cb->data;
-@@ -4631,38 +4617,37 @@ static int nf_tables_dump_obj(struct sk_
+@@ -4664,38 +4650,37 @@ static int nf_tables_dump_obj(struct sk_
rcu_read_lock();
cb->seq = net->nft.base_seq;
}
}
done:
-@@ -4749,7 +4734,8 @@ static int nf_tables_getobj(struct net *
+@@ -4782,7 +4767,8 @@ static int nf_tables_getobj(struct net *
if (IS_ERR(afi))
return PTR_ERR(afi);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -4809,7 +4795,8 @@ static int nf_tables_delobj(struct net *
+@@ -4842,7 +4828,8 @@ static int nf_tables_delobj(struct net *
if (IS_ERR(afi))
return PTR_ERR(afi);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -4820,7 +4807,7 @@ static int nf_tables_delobj(struct net *
+@@ -4853,7 +4840,7 @@ static int nf_tables_delobj(struct net *
if (obj->use > 0)
return -EBUSY;
return nft_delobj(&ctx, obj);
}
-@@ -4858,7 +4845,7 @@ static void nf_tables_obj_notify(const s
+@@ -4891,7 +4878,7 @@ static void nf_tables_obj_notify(const s
struct nft_object *obj, int event)
{
nft_obj_notify(ctx->net, ctx->table, obj, ctx->portid, ctx->seq, event,
}
/*
-@@ -5048,7 +5035,7 @@ void nft_flow_table_iterate(struct net *
+@@ -5081,7 +5068,7 @@ void nft_flow_table_iterate(struct net *
rcu_read_lock();
list_for_each_entry_rcu(afi, &net->nft.af_info, list) {
list_for_each_entry_rcu(flowtable, &table->flowtables, list) {
iter(&flowtable->data, data);
}
-@@ -5096,7 +5083,8 @@ static int nf_tables_newflowtable(struct
+@@ -5129,7 +5116,8 @@ static int nf_tables_newflowtable(struct
if (IS_ERR(afi))
return PTR_ERR(afi);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -5113,7 +5101,7 @@ static int nf_tables_newflowtable(struct
+@@ -5146,7 +5134,7 @@ static int nf_tables_newflowtable(struct
return 0;
}
flowtable = kzalloc(sizeof(*flowtable), GFP_KERNEL);
if (!flowtable)
-@@ -5194,7 +5182,8 @@ static int nf_tables_delflowtable(struct
+@@ -5227,7 +5215,8 @@ static int nf_tables_delflowtable(struct
if (IS_ERR(afi))
return PTR_ERR(afi);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -5205,7 +5194,7 @@ static int nf_tables_delflowtable(struct
+@@ -5238,7 +5227,7 @@ static int nf_tables_delflowtable(struct
if (flowtable->use > 0)
return -EBUSY;
return nft_delflowtable(&ctx, flowtable);
}
-@@ -5274,40 +5263,37 @@ static int nf_tables_dump_flowtable(stru
+@@ -5307,40 +5296,37 @@ static int nf_tables_dump_flowtable(stru
struct net *net = sock_net(skb->sk);
int family = nfmsg->nfgen_family;
struct nft_flowtable *flowtable;
}
}
done:
-@@ -5392,7 +5378,8 @@ static int nf_tables_getflowtable(struct
+@@ -5425,7 +5411,8 @@ static int nf_tables_getflowtable(struct
if (IS_ERR(afi))
return PTR_ERR(afi);
if (IS_ERR(table))
return PTR_ERR(table);
-@@ -5435,7 +5422,7 @@ static void nf_tables_flowtable_notify(s
+@@ -5468,7 +5455,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;
-@@ -5513,17 +5500,14 @@ static int nf_tables_flowtable_event(str
+@@ -5546,17 +5533,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);
-@@ -6549,6 +6533,7 @@ EXPORT_SYMBOL_GPL(nft_data_dump);
+@@ -6582,6 +6566,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;
-@@ -6585,10 +6570,10 @@ static void __nft_release_afinfo(struct
+@@ -6618,10 +6603,10 @@ static void __nft_release_afinfo(struct
struct nft_set *set, *ns;
struct nft_ctx ctx = {
.net = net,
par->nft_compat = true;
}
-@@ -282,7 +282,7 @@ nft_target_destroy(const struct nft_ctx
+@@ -283,7 +283,7 @@ nft_target_destroy(const struct nft_ctx
par.net = ctx->net;
par.target = target;
par.targinfo = info;
if (par.target->destroy != NULL)
par.target->destroy(&par);
-@@ -389,7 +389,7 @@ nft_match_set_mtchk_param(struct xt_mtch
+@@ -409,7 +409,7 @@ nft_match_set_mtchk_param(struct xt_mtch
{
par->net = ctx->net;
par->table = ctx->table->name;
case AF_INET:
entry->e4.ip.proto = proto;
entry->e4.ip.invflags = inv ? IPT_INV_PROTO : 0;
-@@ -420,7 +420,7 @@ nft_match_set_mtchk_param(struct xt_mtch
+@@ -440,7 +440,7 @@ nft_match_set_mtchk_param(struct xt_mtch
} else {
par->hook_mask = 0;
}
par->nft_compat = true;
}
-@@ -503,7 +503,7 @@ __nft_match_destroy(const struct nft_ctx
+@@ -523,7 +523,7 @@ __nft_match_destroy(const struct nft_ctx
par.net = ctx->net;
par.match = match;
par.matchinfo = info;
if (par.match->destroy != NULL)
par.match->destroy(&par);
-@@ -733,7 +733,7 @@ nft_match_select_ops(const struct nft_ct
+@@ -754,7 +754,7 @@ nft_match_select_ops(const struct nft_ct
mt_name = nla_data(tb[NFTA_MATCH_NAME]);
rev = ntohl(nla_get_be32(tb[NFTA_MATCH_REV]));
/* Re-use the existing match if it's already loaded. */
list_for_each_entry(nft_match, &nft_match_list, head) {
-@@ -824,7 +824,7 @@ nft_target_select_ops(const struct nft_c
+@@ -845,7 +845,7 @@ nft_target_select_ops(const struct nft_c
tg_name = nla_data(tb[NFTA_TARGET_NAME]);
rev = ntohl(nla_get_be32(tb[NFTA_TARGET_REV]));