pfsync_bulk_fail was mucking around with pfsync_softc and sending packets
authordlg <dlg@openbsd.org>
Wed, 28 Jul 2010 06:52:05 +0000 (06:52 +0000)
committerdlg <dlg@openbsd.org>
Wed, 28 Jul 2010 06:52:05 +0000 (06:52 +0000)
without holding splsoftnet. this adds the necessary protection.

reported by patrick coleman

sys/net/if_pfsync.c

index 04a1840..c711d8b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_pfsync.c,v 1.153 2010/07/25 23:36:31 jsg Exp $     */
+/*     $OpenBSD: if_pfsync.c,v 1.154 2010/07/28 06:52:05 dlg Exp $     */
 
 /*
  * Copyright (c) 2002 Michael Shalayeff
@@ -2258,6 +2258,9 @@ void
 pfsync_bulk_fail(void *arg)
 {
        struct pfsync_softc *sc = arg;
+       int s;
+
+       s = splsoftnet();
 
        if (sc->sc_bulk_tries++ < PFSYNC_MAX_BULKTRIES) {
                /* Try again */
@@ -2275,6 +2278,8 @@ pfsync_bulk_fail(void *arg)
                pfsync_sync_ok = 1;
                DPFPRINTF(LOG_ERR, "failed to receive bulk update");
        }
+
+       splx(s);
 }
 
 void