summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2004-02-27 21:34:58 +0000
committermillert <millert@openbsd.org>2004-02-27 21:34:58 +0000
commit1a432c62c305994cdfe61a7b1ee946911c5f5bf2 (patch)
treea686059ec5254d5feda74af3b85de510ef5e7aff
parentAdd swiss german keymap tested on PBG4. go ahead and commit miod@ (diff)
downloadwireguard-openbsd-1a432c62c305994cdfe61a7b1ee946911c5f5bf2.tar.xz
wireguard-openbsd-1a432c62c305994cdfe61a7b1ee946911c5f5bf2.zip
Disable interrupts in wi_intr() before sending an ACK. Fixes a
race condition and makes things consistent with the rest of the code. From NetBSD. OK deraadt@
-rw-r--r--sys/dev/ic/if_wi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c
index 510e3ec2303..dd148354b5c 100644
--- a/sys/dev/ic/if_wi.c
+++ b/sys/dev/ic/if_wi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi.c,v 1.102 2003/12/05 02:23:42 drahn Exp $ */
+/* $OpenBSD: if_wi.c,v 1.103 2004/02/27 21:34:58 millert Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -126,7 +126,7 @@ u_int32_t widebug = WIDEBUG;
#if !defined(lint) && !defined(__OpenBSD__)
static const char rcsid[] =
- "$OpenBSD: if_wi.c,v 1.102 2003/12/05 02:23:42 drahn Exp $";
+ "$OpenBSD: if_wi.c,v 1.103 2004/02/27 21:34:58 millert Exp $";
#endif /* lint */
#ifdef foo
@@ -451,8 +451,8 @@ wi_intr(vsc)
ifp = &sc->sc_arpcom.ac_if;
if (!(sc->wi_flags & WI_FLAGS_ATTACHED) || !(ifp->if_flags & IFF_UP)) {
- CSR_WRITE_2(sc, WI_EVENT_ACK, 0xFFFF);
CSR_WRITE_2(sc, WI_INT_EN, 0);
+ CSR_WRITE_2(sc, WI_EVENT_ACK, 0xffff);
return (0);
}