Right now for pfsync(4), but later it will need it to serialize access
to PF data structures.

        splassert: ip_output: want 1 have 0
        ip_output() at ip_output+0x7d
        pfsync_sendout() at pfsync_sendout+0x499
        pfsync_q_ins() at pfsync_q_ins+0x78
        pf_remove_state() at pf_remove_state+0x5d
        pf_purge_expired_states() at pf_purge_expired_states+0x7b
        pf_purge_thread() at pf_purge_thread+0x5c

ok?

Index: net/pf.c
===================================================================
RCS file: /cvs/src/sys/net/pf.c,v
retrieving revision 1.1009
diff -u -p -r1.1009 pf.c
--- net/pf.c    29 Dec 2016 13:01:48 -0000      1.1009
+++ net/pf.c    6 Jan 2017 11:18:41 -0000
@@ -1184,7 +1184,7 @@ pf_purge_thread(void *v)
        for (;;) {
                tsleep(pf_purge_thread, PWAIT, "pftm", 1 * hz);
 
-               s = splsoftnet();
+               NET_LOCK(s);
 
                /* process a fraction of the state table every second */
                pf_purge_expired_states(1 + (pf_status.states
@@ -1198,7 +1198,7 @@ pf_purge_thread(void *v)
                        nloops = 0;
                }
 
-               splx(s);
+               NET_UNLOCK(s);
        }
 }
 

Reply via email to