diff options
author | 2001-03-30 19:22:54 +0000 | |
---|---|---|
committer | 2001-03-30 19:22:54 +0000 | |
commit | 549c8c046f3034b4acbf8f60bad58092a8c8687f (patch) | |
tree | b74eaa0e16a946dab29dfb5e98ca5ceaccda2140 | |
parent | Add a new wsmuxop, dissetdisplay, which wsmux uses to disocver whether a mux (diff) | |
download | wireguard-openbsd-549c8c046f3034b4acbf8f60bad58092a8c8687f.tar.xz wireguard-openbsd-549c8c046f3034b4acbf8f60bad58092a8c8687f.zip |
Protect the IF_XXX macros in the callback routines with splimp(). Doh!
Thanks to erik@ipunplugged.com
-rw-r--r-- | sys/netinet/ipsec_input.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/netinet/ipsec_input.c b/sys/netinet/ipsec_input.c index 6f36319a611..e3284ddb362 100644 --- a/sys/netinet/ipsec_input.c +++ b/sys/netinet/ipsec_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipsec_input.c,v 1.34 2001/03/28 20:03:06 angelos Exp $ */ +/* $OpenBSD: ipsec_input.c,v 1.35 2001/03/30 19:22:54 angelos Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), @@ -616,6 +616,7 @@ int ah4_input_cb(struct mbuf *m, ...) { struct ifqueue *ifq = &ipintrq; + int s = splimp(); /* * Interface pointer is already in first mbuf; chop off the @@ -625,15 +626,18 @@ ah4_input_cb(struct mbuf *m, ...) if (IF_QFULL(ifq)) { IF_DROP(ifq); - m_freem(m); ahstat.ahs_qfull++; + splx(s); + m_freem(m); DPRINTF(("ah4_input_cb(): dropped packet because of full IP queue\n")); return ENOBUFS; } IF_ENQUEUE(ifq, m); schednetisr(NETISR_IP); + splx(s); + return 0; } @@ -657,6 +661,7 @@ int esp4_input_cb(struct mbuf *m, ...) { struct ifqueue *ifq = &ipintrq; + int s = splimp(); /* * Interface pointer is already in first mbuf; chop off the @@ -665,15 +670,18 @@ esp4_input_cb(struct mbuf *m, ...) if (IF_QFULL(ifq)) { IF_DROP(ifq); - m_freem(m); espstat.esps_qfull++; + splx(s); + m_freem(m); DPRINTF(("esp4_input_cb(): dropped packet because of full IP queue\n")); return ENOBUFS; } IF_ENQUEUE(ifq, m); schednetisr(NETISR_IP); + splx(s); + return 0; } #endif /* INET */ |