*
* @list: table set list node
* @bindings: list of set bindings
+ * @table: table this set belongs to
* @name: name of the set
* @ktype: key type (numeric type defined by userspace, not used in the kernel)
* @dtype: data type (verdict or numeric type defined by userspace)
struct nft_set {
struct list_head list;
struct list_head bindings;
+ struct nft_table *table;
char *name;
u32 ktype;
u32 dtype;
}
static struct nft_set *nf_tables_set_lookup_byid(const struct net *net,
+ const struct nft_table *table,
const struct nlattr *nla,
u8 genmask)
{
struct nft_set *set = nft_trans_set(trans);
if (id == nft_trans_set_id(trans) &&
+ set->table == table &&
nft_active_genmask(set, genmask))
return set;
}
if (!nla_set_id)
return set;
- set = nf_tables_set_lookup_byid(net, nla_set_id, genmask);
+ set = nf_tables_set_lookup_byid(net, table, nla_set_id, genmask);
}
return set;
}
}
INIT_LIST_HEAD(&set->bindings);
+ set->table = table;
set->ops = ops;
set->ktype = ktype;
set->klen = desc.klen;
genmask);
if (IS_ERR(set)) {
if (nla[NFTA_SET_ELEM_LIST_SET_ID]) {
- set = nf_tables_set_lookup_byid(net,
+ set = nf_tables_set_lookup_byid(net, ctx.table,
nla[NFTA_SET_ELEM_LIST_SET_ID],
genmask);
}