table. Hence we have to grab both the pf lock and the pf state lock.
Found by dlg@
ok bluhm@ sashan@
-/* $OpenBSD: pf.c,v 1.1109 2021/02/12 13:48:31 bluhm Exp $ */
+/* $OpenBSD: pf.c,v 1.1110 2021/02/12 16:16:10 patrick Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
{
struct pf_state_item *si;
+ PF_ASSERT_UNLOCKED();
+
+ PF_LOCK();
+ PF_STATE_ENTER_WRITE();
TAILQ_FOREACH(si, &sk->states, entry) {
if (sk == si->s->key[PF_SK_STACK] && si->s->rule.ptr &&
(si->s->rule.ptr->divert.type == PF_DIVERT_TO ||
break;
}
}
+ PF_STATE_EXIT_WRITE();
+ PF_UNLOCK();
}
void