diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2015-03-29 13:32:10 +0200 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2015-03-29 16:46:42 +0200 |
commit | fde037966a25e8549b8c76c2940a74dd0f39688c (patch) | |
tree | aec3889a0d81277beccf81efe18200618aed709c /kernel | |
parent | 987e167158651ab2a1089c7be93f5431187d18d0 (diff) |
Make sure the proper is_destroyed value is checked at dumping
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/net/netfilter/ipset/ip_set_core.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/net/netfilter/ipset/ip_set_core.c b/kernel/net/netfilter/ipset/ip_set_core.c index e20bfa5..5319896 100644 --- a/kernel/net/netfilter/ipset/ip_set_core.c +++ b/kernel/net/netfilter/ipset/ip_set_core.c @@ -1257,6 +1257,7 @@ ip_set_dump_start(struct sk_buff *skb, struct netlink_callback *cb) unsigned int flags = NETLINK_PORTID(cb->skb) ? NLM_F_MULTI : 0; struct ip_set_net *inst = ip_set_pernet(sock_net(skb->sk)); u32 dump_type, dump_flags; + bool is_destroyed; int ret = 0; if (!cb->args[IPSET_CB_DUMP]) { @@ -1286,13 +1287,14 @@ dump_last: index = (ip_set_id_t)cb->args[IPSET_CB_INDEX]; write_lock_bh(&ip_set_ref_lock); set = ip_set(inst, index); - if (set == NULL || inst->is_destroyed) { + is_destroyed = inst->is_destroyed; + if (set == NULL || is_destroyed) { write_unlock_bh(&ip_set_ref_lock); if (dump_type == DUMP_ONE) { ret = -ENOENT; goto out; } - if (inst->is_destroyed) { + if (is_destroyed) { /* All sets are just being destroyed */ ret = 0; goto out; |