mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 07:00:48 +00:00
netfilter: ipset: list:set: make sure all elements are checked by the gc
When an element timed out, the next one was skipped by the garbage collector, fixed. Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
This commit is contained in:
parent
40cd63bf33
commit
b91b396d5e
@ -218,13 +218,16 @@ set_cleanup_entries(struct ip_set *set)
|
||||
{
|
||||
struct list_set *map = set->data;
|
||||
struct set_elem *e;
|
||||
u32 i;
|
||||
u32 i = 0;
|
||||
|
||||
for (i = 0; i < map->size; i++) {
|
||||
while (i < map->size) {
|
||||
e = list_set_elem(set, map, i);
|
||||
if (e->id != IPSET_INVALID_ID &&
|
||||
ip_set_timeout_expired(ext_timeout(e, set)))
|
||||
list_set_del(set, i);
|
||||
/* Check element moved to position i in next loop */
|
||||
else
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user