From: dlg Date: Wed, 28 Jul 2010 06:52:05 +0000 (+0000) Subject: pfsync_bulk_fail was mucking around with pfsync_softc and sending packets X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=836e28141f097fd7f6dad73a702d776ddf270c83;p=openbsd pfsync_bulk_fail was mucking around with pfsync_softc and sending packets without holding splsoftnet. this adds the necessary protection. reported by patrick coleman --- diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index 04a1840ee7e..c711d8b04af 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -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