-/* $OpenBSD: pf.c,v 1.1119 2021/06/23 04:16:32 dlg Exp $ */
+/* $OpenBSD: pf.c,v 1.1120 2021/06/23 05:51:27 dlg Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
static struct pf_state *cur = NULL;
struct pf_state *next;
SLIST_HEAD(pf_state_gcl, pf_state) gcl;
+ time_t now;
PF_ASSERT_UNLOCKED();
SLIST_INIT(&gcl);
PF_STATE_ENTER_READ();
+
+ now = getuptime();
+
while (maxcheck--) {
uint8_t stimeout;
stimeout = cur->timeout;
if ((stimeout == PFTM_UNLINKED) ||
- (pf_state_expires(cur, stimeout) <= getuptime()))
+ (pf_state_expires(cur, stimeout) <= now))
SLIST_INSERT_HEAD(&gcl, cur, gc_list);
else
pf_state_unref(cur);