diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-01-09 17:10:04 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-01-09 17:10:04 +0000 |
commit | e581c457190d7add6ab7b199822672c1c23d4f7e (patch) | |
tree | 38268d56f835c13a328d4e01c33547ee7f231621 /sys/netinet/ip_ah.c | |
parent | 62497fbfdf5832b3b402558f767d6eda71a0260f (diff) |
Grab the NET_LOCK() in various callbacks.
Fix an assert reported by Hrvoje Popovski.
ok visa@, mikeb@
Diffstat (limited to 'sys/netinet/ip_ah.c')
-rw-r--r-- | sys/netinet/ip_ah.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c index 058ea52370b..70ea9af11d1 100644 --- a/sys/netinet/ip_ah.c +++ b/sys/netinet/ip_ah.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ah.c,v 1.124 2016/12/24 11:17:35 mpi Exp $ */ +/* $OpenBSD: ip_ah.c,v 1.125 2017/01/09 17:10:02 mpi Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -727,7 +727,7 @@ ah_input_cb(struct cryptop *crp) return (EINVAL); } - s = splsoftnet(); + NET_LOCK(s); tdb = gettdb(tc->tc_rdomain, tc->tc_spi, &tc->tc_dst, tc->tc_proto); if (tdb == NULL) { @@ -746,7 +746,7 @@ ah_input_cb(struct cryptop *crp) /* Reset the session ID */ if (tdb->tdb_cryptoid != 0) tdb->tdb_cryptoid = crp->crp_sid; - splx(s); + NET_UNLOCK(s); return crypto_dispatch(crp); } free(tc, M_XDATA, 0); @@ -836,7 +836,7 @@ ah_input_cb(struct cryptop *crp) m1 = m_getptr(m, skip, &roff); if (m1 == NULL) { ahstat.ahs_hdrops++; - splx(s); + NET_UNLOCK(s); m_freem(m); DPRINTF(("ah_input(): bad mbuf chain for packet in SA " @@ -905,11 +905,11 @@ ah_input_cb(struct cryptop *crp) } error = ipsec_common_input_cb(m, tdb, skip, protoff); - splx(s); + NET_UNLOCK(s); return (error); baddone: - splx(s); + NET_UNLOCK(s); m_freem(m); |