summaryrefslogtreecommitdiffstats
path: root/sys/netatm
diff options
context:
space:
mode:
authortanimura <tanimura@FreeBSD.org>2002-05-31 11:52:35 +0000
committertanimura <tanimura@FreeBSD.org>2002-05-31 11:52:35 +0000
commite6fa9b9e922913444c2e6b2b58bf3de5eaed868d (patch)
tree9d5f24794525313566896ab89aa860515db344a6 /sys/netatm
parent1ea6cbb8c29088e04528460633798a6c131ca1ba (diff)
downloadFreeBSD-src-e6fa9b9e922913444c2e6b2b58bf3de5eaed868d.zip
FreeBSD-src-e6fa9b9e922913444c2e6b2b58bf3de5eaed868d.tar.gz
Back out my lats commit of locking down a socket, it conflicts with hsu's work.
Requested by: hsu
Diffstat (limited to 'sys/netatm')
-rw-r--r--sys/netatm/atm_aal5.c15
-rw-r--r--sys/netatm/atm_socket.c21
2 files changed, 3 insertions, 33 deletions
diff --git a/sys/netatm/atm_aal5.c b/sys/netatm/atm_aal5.c
index 63caed2..ab6a95a 100644
--- a/sys/netatm/atm_aal5.c
+++ b/sys/netatm/atm_aal5.c
@@ -771,24 +771,19 @@ atm_aal5_cpcs_data(tok, m)
* Ensure that the socket is able to receive data and
* that there's room in the socket buffer
*/
- SOCK_LOCK(so);
if (((so->so_state & SS_ISCONNECTED) == 0) ||
(so->so_state & SS_CANTRCVMORE) ||
(len > sbspace(&so->so_rcv))) {
- SOCK_UNLOCK(so);
atm_sock_stat.as_indrop[atp->atp_type]++;
KB_FREEALL(m);
return;
}
- SOCK_UNLOCK(so);
/*
* Queue the data and notify the user
*/
sbappendrecord(&so->so_rcv, m);
- SOCK_LOCK(so);
sorwakeup(so);
- SOCK_UNLOCK(so);
return;
}
@@ -840,12 +835,9 @@ atm_aal5_ctloutput(so, sopt)
case T_ATM_ADD_LEAF:
case T_ATM_DROP_LEAF:
- SOCK_LOCK(so);
if ((so->so_state & SS_ISCONNECTED) == 0) {
- SOCK_UNLOCK(so);
ATM_RETERR(ENOTCONN);
- } else
- SOCK_UNLOCK(so);
+ }
break;
case T_ATM_CAUSE:
@@ -853,12 +845,9 @@ atm_aal5_ctloutput(so, sopt)
break;
default:
- SOCK_LOCK(so);
if (so->so_state & SS_ISCONNECTED) {
- SOCK_UNLOCK(so);
ATM_RETERR(EISCONN);
- } else
- SOCK_UNLOCK(so);
+ }
break;
}
diff --git a/sys/netatm/atm_socket.c b/sys/netatm/atm_socket.c
index 4862c47..6ff6abc 100644
--- a/sys/netatm/atm_socket.c
+++ b/sys/netatm/atm_socket.c
@@ -181,7 +181,6 @@ atm_sock_detach(so)
* Break links and free control blocks
*/
so->so_pcb = NULL;
- SOCK_LOCK(so);
sotryfree(so);
uma_zfree(atm_pcb_zone, atp);
@@ -494,9 +493,7 @@ atm_sock_connect(so, addr, epp)
/*
* We're finally ready to initiate the ATM connection
*/
- SOCK_LOCK(so);
soisconnecting(so);
- SOCK_UNLOCK(so);
atm_sock_stat.as_connreq[atp->atp_type]++;
err = atm_cm_connect(epp, atp, &atp->atp_attr, &atp->atp_conn);
if (err == 0) {
@@ -504,9 +501,7 @@ atm_sock_connect(so, addr, epp)
* Connection is setup
*/
atm_sock_stat.as_conncomp[atp->atp_type]++;
- SOCK_LOCK(so);
soisconnected(so);
- SOCK_UNLOCK(so);
} else if (err == EINPROGRESS) {
/*
@@ -519,9 +514,7 @@ atm_sock_connect(so, addr, epp)
* Call failed...
*/
atm_sock_stat.as_connfail[atp->atp_type]++;
- SOCK_LOCK(so);
soisdisconnected(so);
- SOCK_UNLOCK(so);
}
return (err);
@@ -571,9 +564,7 @@ atm_sock_disconnect(so)
atp->atp_conn = NULL;
}
- SOCK_LOCK(so);
soisdisconnected(so);
- SOCK_UNLOCK(so);
return (0);
}
@@ -670,9 +661,7 @@ atm_sock_peeraddr(so, addr)
satm->satm_family = AF_ATM;
satm->satm_len = sizeof(*satm);
saddr = &satm->satm_addr.t_atm_sap_addr;
- SOCK_LOCK(so);
if (so->so_state & SS_ISCONNECTED) {
- SOCK_UNLOCK(so);
cvp = atp->atp_conn->co_connvc;
saddr->SVE_tag_addr = T_ATM_PRESENT;
if (cvp->cvc_flags & CVCF_CALLER) {
@@ -691,7 +680,6 @@ atm_sock_peeraddr(so, addr)
else
saddr->SVE_tag_selector = T_ATM_ABSENT;
} else {
- SOCK_UNLOCK(so);
saddr->SVE_tag_addr = T_ATM_ABSENT;
saddr->SVE_tag_selector = T_ATM_ABSENT;
saddr->address_format = T_ATM_ABSENT;
@@ -1099,12 +1087,10 @@ atm_sock_getopt(so, sopt, atp)
* If socket is connected, return attributes for the VCC in use,
* otherwise just return what the user has setup so far.
*/
- SOCK_LOCK(so);
if (so->so_state & SS_ISCONNECTED)
ap = &atp->atp_conn->co_connvc->cvc_attr;
else
ap = &atp->atp_attr;
- SOCK_UNLOCK(so);
switch (sopt->sopt_name) {
@@ -1282,9 +1268,7 @@ atm_sock_connected(toku)
* Connection is setup
*/
atm_sock_stat.as_conncomp[atp->atp_type]++;
- SOCK_LOCK(atp->atp_socket);
soisconnected(atp->atp_socket);
- SOCK_UNLOCK(atp->atp_socket);
}
@@ -1318,7 +1302,6 @@ atm_sock_cleared(toku, cause)
/*
* Set user error code
*/
- SOCK_LOCK(so);
if (so->so_state & SS_ISCONNECTED) {
so->so_error = ECONNRESET;
atm_sock_stat.as_connclr[atp->atp_type]++;
@@ -1337,9 +1320,7 @@ atm_sock_cleared(toku, cause)
* Cleanup failed incoming connection setup
*/
if (so->so_state & SS_NOFDREF) {
- SOCK_UNLOCK(so);
(void) atm_sock_detach(so);
- } else
- SOCK_UNLOCK(so);
+ }
}
OpenPOWER on IntegriCloud