Hello Lyndon,
this assert has been removed in current (revision 1.310). The complete diff
reads as follows:
--------8<---------------8<---------------8<------------------8<--------
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index d279ede9cd6..64a2da195ab 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.309 2022/11/06 21:34:01 kn Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.310 2022/11/11 11:22:48 sashan Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -1362,10 +1362,17 @@ pfsync_grab_snapshot(struct pfsync_snapshot *sn, struct
pfsync_softc *sc)
TAILQ_INIT(&sn->sn_qs[q]);
while ((st = TAILQ_FIRST(&sc->sc_qs[q])) != NULL) {
- KASSERT(st->snapped == 0);
TAILQ_REMOVE(&sc->sc_qs[q], st, sync_list);
- TAILQ_INSERT_TAIL(&sn->sn_qs[q], st, sync_snap);
- st->snapped = 1;
+ if (st->snapped == 0) {
+ TAILQ_INSERT_TAIL(&sn->sn_qs[q], st, sync_snap);
+ st->snapped = 1;
+ } else {
+ /*
+ * item is on snapshot list already, so we can
+ * skip it now.
+ */
+ pf_state_unref(st);
+ }
}
}
--------8<---------------8<---------------8<------------------8<--------
commit changes the assert to regular condition. Not sure if diff applies
cleanly to 7.2
regards
sashan
On Tue, Feb 21, 2023 at 11:58:51AM -0800, Lyndon Nerenberg (VE7TFX/VE6BBM)
wrote:
> Perhaps related to the recent discussion about pf errors? This
> happened this morning, on a fully patched 7.2 amd64. dmesg and other
> info available on request.
>
> ddb{0}> bt
> db_enter() at db_enter+0x10
> panic(ffffffff81f30a19) at panic+0xbf
> __assert(ffffffff81fa0761,ffffffff81fd3154,637,ffffffff81f6b8f7) at
> __assert+0x
> 25
> pfsync_grab_snapshot(ffff8000211e0ee0,ffff800000b57000) at
> pfsync_grab_snapshot
> +0x308
> pfsync_sendout() at pfsync_sendout+0x89
> pfsync_update_state(fffffd905d068020) at pfsync_update_state+0x15b
> pf_test(2,3,ffff800000b65000,ffff8000211e1258) at pf_test+0x117a
> ip_output(fffffd806e7ce500,0,ffff8000211e13e8,1,0,0,e42ab41b1c818e9c) at
> ip_out
> put+0x6b7
> ip_forward(fffffd806e7ce500,ffff800000b53800,fffffd8d52297390,0) at
> ip_forward+
> 0x2da
> ip_input_if(ffff8000211e1528,ffff8000211e1534,4,0,ffff800000b53800) at
> ip_input
> _if+0x35c
> ipv4_input(ffff800000b53800,fffffd806e7ce500) at ipv4_input+0x39
> ether_input(ffff800000b53800,fffffd806e7ce500) at ether_input+0x3b1
> carp_input(ffff800000b67800,fffffd806e7ce500,5e000106) at carp_input+0x196
> ether_input(ffff800000b67800,fffffd806e7ce500) at ether_input+0x1d9
> vlan_input(ffff800000b39000,fffffd806e7ce500,ffff8000211e175c) at
> vlan_input+0x
> 23d
> ether_input(ffff800000b39000,fffffd806e7ce500) at ether_input+0x85
> if_input_process(ffff8000002c5048,ffff8000211e17f8) at if_input_process+0x6f
> ifiq_process(ffff8000002c8600) at ifiq_process+0x69
> taskq_thread(ffff800000033200) at taskq_thread+0x100
> end trace frame: 0x0, count: -19
> ddb{0}> show panic
> *cpu0: kernel diagnostic assertion "st->snapped == 0" failed: file
> "/usr/src/sy
> s/net/if_pfsync.c", line 1591
> cpu3: kernel diagnostic assertion "st->snapped == 0" failed: file
> "/usr/src/sy
> s/net/if_pfsync.c", line 1591
> cpu1: kernel diagnostic assertion "st->snapped == 0" failed: file
> "/usr/src/sy
> s/net/if_pfsync.c", line 1591
> ddb{0}>
>
> --lyndon
>