On Mon, Dec 19, 2016 at 11:46:32AM +0100, Martin Pieuchot wrote: > These timeouts can end up in ip_output(). So they need the NET_LOCK(). > > ok?
OK bluhm@ > > Index: net/if_pfsync.c > =================================================================== > RCS file: /cvs/src/sys/net/if_pfsync.c,v > retrieving revision 1.238 > diff -u -p -r1.238 if_pfsync.c > --- net/if_pfsync.c 22 Nov 2016 19:29:54 -0000 1.238 > +++ net/if_pfsync.c 19 Dec 2016 10:40:38 -0000 > @@ -1788,9 +1788,9 @@ pfsync_defer_tmo(void *arg) > { > int s; > > - s = splsoftnet(); > + NET_LOCK(s); > pfsync_undefer(arg, 0); > - splx(s); > + NET_UNLOCK(s); > } > > void > @@ -2206,8 +2206,7 @@ pfsync_bulk_update(void *arg) > int i = 0; > int s; > > - s = splsoftnet(); > - > + NET_LOCK(s); > st = sc->sc_bulk_next; > > for (;;) { > @@ -2238,8 +2237,7 @@ pfsync_bulk_update(void *arg) > break; > } > } > - > - splx(s); > + NET_UNLOCK(s); > } > > void > @@ -2271,7 +2269,7 @@ pfsync_bulk_fail(void *arg) > struct pfsync_softc *sc = arg; > int s; > > - s = splsoftnet(); > + NET_LOCK(s); > > if (sc->sc_bulk_tries++ < PFSYNC_MAX_BULKTRIES) { > /* Try again */ > @@ -2297,8 +2295,7 @@ pfsync_bulk_fail(void *arg) > sc->sc_link_demoted = 0; > DPFPRINTF(LOG_ERR, "failed to receive bulk update"); > } > - > - splx(s); > + NET_UNLOCK(s); > } > > void > @@ -2347,9 +2344,9 @@ pfsync_timeout(void *arg) > { > int s; > > - s = splsoftnet(); > + NET_LOCK(s); > pfsync_sendout(); > - splx(s); > + NET_UNLOCK(s); > } > > /* this is a softnet/netisr handler */