From 23574c86734ab5cb088584d30345e698cbbeaef2 Mon Sep 17 00:00:00 2001 From: rwatson Date: Mon, 6 Aug 2007 14:26:03 +0000 Subject: Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which previously conditionally acquired Giant based on debug.mpsafenet. As that has now been removed, they are no longer required. Removing them significantly simplifies error-handling in the socket layer, eliminated quite a bit of unwinding of locking in error cases. While here clean up the now unneeded opt_net.h, which previously was used for the NET_WITH_GIANT kernel option. Clean up some related gotos for consistency. Reviewed by: bz, csjp Tested by: kris Approved by: re (kensmith) --- sys/netipsec/xform_esp.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'sys/netipsec/xform_esp.c') diff --git a/sys/netipsec/xform_esp.c b/sys/netipsec/xform_esp.c index 36bd01e..1900980 100644 --- a/sys/netipsec/xform_esp.c +++ b/sys/netipsec/xform_esp.c @@ -462,8 +462,6 @@ esp_input_cb(struct cryptop *crp) struct secasindex *saidx; caddr_t ptr; - NET_LOCK_GIANT(); - crd = crp->crp_desc; IPSEC_ASSERT(crd != NULL, ("null crypto descriptor!")); @@ -501,7 +499,6 @@ esp_input_cb(struct cryptop *crp) if (crp->crp_etype == EAGAIN) { KEY_FREESAV(&sav); error = crypto_dispatch(crp); - NET_UNLOCK_GIANT(); return error; } @@ -631,7 +628,6 @@ esp_input_cb(struct cryptop *crp) IPSEC_COMMON_INPUT_CB(m, sav, skip, protoff, mtag); KEY_FREESAV(&sav); - NET_UNLOCK_GIANT(); return error; bad: if (sav) @@ -642,7 +638,6 @@ bad: free(tc, M_XDATA); if (crp != NULL) crypto_freereq(crp); - NET_UNLOCK_GIANT(); return error; } @@ -896,8 +891,6 @@ esp_output_cb(struct cryptop *crp) struct mbuf *m; int err, error; - NET_LOCK_GIANT(); - tc = (struct tdb_crypto *) crp->crp_opaque; IPSEC_ASSERT(tc != NULL, ("null opaque data area!")); m = (struct mbuf *) crp->crp_buf; @@ -926,7 +919,6 @@ esp_output_cb(struct cryptop *crp) KEY_FREESAV(&sav); IPSECREQUEST_UNLOCK(isr); error = crypto_dispatch(crp); - NET_UNLOCK_GIANT(); return error; } @@ -973,7 +965,6 @@ esp_output_cb(struct cryptop *crp) err = ipsec_process_done(m, isr); KEY_FREESAV(&sav); IPSECREQUEST_UNLOCK(isr); - NET_UNLOCK_GIANT(); return err; bad: if (sav) @@ -983,7 +974,6 @@ bad: m_freem(m); free(tc, M_XDATA); crypto_freereq(crp); - NET_UNLOCK_GIANT(); return error; } -- cgit v1.1