mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 16:25:34 +00:00
netfilter: ipset: Support the -exist flag with the destroy command
The -exist flag was supported with the create, add and delete commands. In order to gracefully handle the destroy command with nonexistent sets, the -exist flag is added to destroy too. Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
6bbb9ad36c
commit
a304ea7daf
1 changed files with 3 additions and 1 deletions
|
@ -1239,10 +1239,12 @@ static int ip_set_destroy(struct net *net, struct sock *ctnl,
|
|||
/* Modified by ip_set_destroy() only, which is serialized */
|
||||
inst->is_destroyed = false;
|
||||
} else {
|
||||
u32 flags = flag_exist(nlh);
|
||||
s = find_set_and_id(inst, nla_data(attr[IPSET_ATTR_SETNAME]),
|
||||
&i);
|
||||
if (!s) {
|
||||
ret = -ENOENT;
|
||||
if (!(flags & IPSET_FLAG_EXIST))
|
||||
ret = -ENOENT;
|
||||
goto out;
|
||||
} else if (s->ref || s->ref_netlink) {
|
||||
ret = -IPSET_ERR_BUSY;
|
||||
|
|
Loading…
Add table
Reference in a new issue