|
@@ -4032,17 +4032,10 @@ static int nf_tables_newsetelem(struct net *net, struct sock *nlsk,
|
|
|
if (err < 0)
|
|
|
return err;
|
|
|
|
|
|
- set = nf_tables_set_lookup(ctx.table, nla[NFTA_SET_ELEM_LIST_SET],
|
|
|
- genmask);
|
|
|
- if (IS_ERR(set)) {
|
|
|
- if (nla[NFTA_SET_ELEM_LIST_SET_ID]) {
|
|
|
- set = nf_tables_set_lookup_byid(net,
|
|
|
- nla[NFTA_SET_ELEM_LIST_SET_ID],
|
|
|
- genmask);
|
|
|
- }
|
|
|
- if (IS_ERR(set))
|
|
|
- return PTR_ERR(set);
|
|
|
- }
|
|
|
+ set = nft_set_lookup_global(net, ctx.table, nla[NFTA_SET_ELEM_LIST_SET],
|
|
|
+ nla[NFTA_SET_ELEM_LIST_SET_ID], genmask);
|
|
|
+ if (IS_ERR(set))
|
|
|
+ return PTR_ERR(set);
|
|
|
|
|
|
if (!list_empty(&set->bindings) && set->flags & NFT_SET_CONSTANT)
|
|
|
return -EBUSY;
|