diff options
Diffstat (limited to 'sys/netns/idp_usrreq.c')
-rw-r--r-- | sys/netns/idp_usrreq.c | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/sys/netns/idp_usrreq.c b/sys/netns/idp_usrreq.c index 6ca054d..5203961 100644 --- a/sys/netns/idp_usrreq.c +++ b/sys/netns/idp_usrreq.c @@ -97,9 +97,7 @@ idp_input(m, nsp) if (sbappendaddr(&nsp->nsp_socket->so_rcv, (struct sockaddr *)&idp_ns, m, (struct mbuf *)0) == 0) goto bad; - SOCK_LOCK(nsp->nsp_socket); sorwakeup(nsp->nsp_socket); - SOCK_UNLOCK(nsp->nsp_socket); return; bad: m_freem(m); @@ -111,9 +109,7 @@ idp_abort(nsp) struct socket *so = nsp->nsp_socket; ns_pcbdisconnect(nsp); - SOCK_LOCK(so); soisdisconnected(so); - SOCK_UNLOCK(so); } /* * Drop connection, reporting @@ -137,9 +133,7 @@ idp_drop(nsp, errno) }*/ so->so_error = errno; ns_pcbdisconnect(nsp); - SOCK_LOCK(so); soisdisconnected(so); - SOCK_UNLOCK(so); } int noIdpRoute; @@ -154,7 +148,6 @@ idp_output(nsp, m0) register struct route *ro; struct mbuf *mprev; extern int idpcksum; - int soopts; /* * Calculate data length. @@ -218,14 +211,9 @@ idp_output(nsp, m0) * Output datagram. */ so = nsp->nsp_socket; - SOCK_LOCK(so); - if (so->so_options & SO_DONTROUTE) { - soopts = so->so_options & SO_BROADCAST; - SO_UNLOCK(so); + if (so->so_options & SO_DONTROUTE) return (ns_output(m, (struct route *)0, - soopts | NS_ROUTETOIF)); - } - SO_UNLOCK(so); + (so->so_options & SO_BROADCAST) | NS_ROUTETOIF)); /* * Use cached route for previous datagram if * possible. If the previous net was the same @@ -269,10 +257,7 @@ idp_output(nsp, m0) nsp->nsp_lastdst = idp->idp_dna; #endif /* ancient_history */ if (noIdpRoute) ro = 0; - SOCK_LOCK(so); - soopts = so->so_options & SO_BROADCAST; - SOCK_UNLOCK(so); - return (ns_output(m, ro, soopts)); + return (ns_output(m, ro, so->so_options & SO_BROADCAST)); } /* ARGSUSED */ idp_ctloutput(req, so, level, name, value) @@ -442,11 +427,8 @@ idp_usrreq(so, req, m, nam, control) break; } error = ns_pcbconnect(nsp, nam); - if (error == 0) { - SOCK_LOCK(so); + if (error == 0) soisconnected(so); - SOCK_UNLOCK(so); - } break; case PRU_CONNECT2: @@ -463,9 +445,7 @@ idp_usrreq(so, req, m, nam, control) break; } ns_pcbdisconnect(nsp); - SOCK_LOCK(so); soisdisconnected(so); - SOCK_UNLOCK(so); break; case PRU_SHUTDOWN: @@ -511,11 +491,8 @@ idp_usrreq(so, req, m, nam, control) case PRU_ABORT: ns_pcbdetach(nsp); - SOCK_LOCK(so); sotryfree(so); - SOCK_LOCK(so); soisdisconnected(so); /* XXX huh, called after sofree()? */ - SOCK_UNLOCK(so); break; case PRU_SOCKADDR: @@ -569,13 +546,10 @@ idp_raw_usrreq(so, req, m, nam, control) case PRU_ATTACH: - SOCK_LOCK(so); if (!(so->so_state & SS_PRIV) || (nsp != NULL)) { - SOCK_UNLOCK(so); error = EINVAL; break; } - SOCK_UNLOCK(so); error = ns_pcballoc(so, &nsrawpcb); if (error) break; |