From: aisha Date: Thu, 28 Dec 2023 16:21:08 +0000 (+0000) Subject: use RB_FOREACH_SAFE for pf_purge_expired_src_nodes X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=00a8a9e1c78c4e16daca67f82638f39fc4902de5;p=openbsd use RB_FOREACH_SAFE for pf_purge_expired_src_nodes OK bluhm@ --- diff --git a/sys/net/pf.c b/sys/net/pf.c index c4cd86a3514..c859a1467ec 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.1189 2023/12/01 10:28:32 sashan Exp $ */ +/* $OpenBSD: pf.c,v 1.1190 2023/12/28 16:21:08 aisha Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1731,11 +1731,8 @@ pf_purge_expired_src_nodes(void) PF_ASSERT_LOCKED(); - for (cur = RB_MIN(pf_src_tree, &tree_src_tracking); cur; cur = next) { - next = RB_NEXT(pf_src_tree, &tree_src_tracking, cur); - + RB_FOREACH_SAFE(cur, pf_src_tree, &tree_src_tracking, next) { if (cur->states == 0 && cur->expire <= getuptime()) { - next = RB_NEXT(pf_src_tree, &tree_src_tracking, cur); pf_remove_src_node(cur); } }