From 00a8a9e1c78c4e16daca67f82638f39fc4902de5 Mon Sep 17 00:00:00 2001 From: aisha Date: Thu, 28 Dec 2023 16:21:08 +0000 Subject: [PATCH] use RB_FOREACH_SAFE for pf_purge_expired_src_nodes OK bluhm@ --- sys/net/pf.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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); } } -- 2.20.1