Commit 509debc9 authored by Jozsef Kadlecsik's avatar Jozsef Kadlecsik

netfilter: ipset: Simplify mtype_expire() for hash types

Remove one leve of intendation by using continue while
iterating over elements in bucket.

Ported from a patch proposed by Sergey Popovich <popovich_sergei@mail.ua>.
Signed-off-by: default avatarJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
parent 5fdb5f69
...@@ -487,21 +487,20 @@ mtype_expire(struct ip_set *set, struct htype *h) ...@@ -487,21 +487,20 @@ mtype_expire(struct ip_set *set, struct htype *h)
continue; continue;
} }
data = ahash_data(n, j, dsize); data = ahash_data(n, j, dsize);
if (ip_set_timeout_expired(ext_timeout(data, set))) { if (!ip_set_timeout_expired(ext_timeout(data, set)))
pr_debug("expired %u/%u\n", i, j); continue;
clear_bit(j, n->used); pr_debug("expired %u/%u\n", i, j);
smp_mb__after_atomic(); clear_bit(j, n->used);
smp_mb__after_atomic();
#ifdef IP_SET_HASH_WITH_NETS #ifdef IP_SET_HASH_WITH_NETS
for (k = 0; k < IPSET_NET_COUNT; k++) for (k = 0; k < IPSET_NET_COUNT; k++)
mtype_del_cidr(h, mtype_del_cidr(h,
NCIDR_PUT(DCIDR_GET(data->cidr, NCIDR_PUT(DCIDR_GET(data->cidr, k)),
k)), nets_length, k);
nets_length, k);
#endif #endif
ip_set_ext_destroy(set, data); ip_set_ext_destroy(set, data);
set->elements--; set->elements--;
d++; d++;
}
} }
if (d >= AHASH_INIT_SIZE) { if (d >= AHASH_INIT_SIZE) {
if (d >= n->size) { if (d >= n->size) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment