summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_usrreq.c
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2007-09-18 15:16:39 +0000
committerrrs <rrs@FreeBSD.org>2007-09-18 15:16:39 +0000
commitaf4581daa3b78241d03ce0070a301d0e3f74f81e (patch)
treebe1aff5d805ccf732aa9f6351a7147deea3641e7 /sys/netinet/sctp_usrreq.c
parent7100da0db27ffd5bfd649ef9860d16032761e89b (diff)
downloadFreeBSD-src-af4581daa3b78241d03ce0070a301d0e3f74f81e.zip
FreeBSD-src-af4581daa3b78241d03ce0070a301d0e3f74f81e.tar.gz
- The address lock is changed to a rwlock. This
also involves macro changes to have a RLOCK and a WLOCK and placing the correct version within the code. - The INP-INFO lock is changed to a rwlock. - When sctp_shutdown() is called on Mac OS X, the socket lock is held. So call sctp_chunk_output with SCTP_SO_LOCKED and not SCTP_SO_NOT_LOCKED. - Add SCTP_IPI_ADDR_[RW]LOCK and SCTP_IPI_ADDR_[RW]UNLOCK for Mac OS X. - u_int64_t -> uint64_t - add missing addr unlock for error return path Approved by: re@freebsd.org (K Smith)
Diffstat (limited to 'sys/netinet/sctp_usrreq.c')
-rw-r--r--sys/netinet/sctp_usrreq.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c
index 77f15ae..9d3c55b 100644
--- a/sys/netinet/sctp_usrreq.c
+++ b/sys/netinet/sctp_usrreq.c
@@ -964,7 +964,7 @@ sctp_shutdown(struct socket *so)
sctp_stop_timers_for_shutdown(stcb);
sctp_send_shutdown(stcb,
stcb->asoc.primary_destination);
- sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_NOT_LOCKED);
+ sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_LOCKED);
if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) ||
(SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) {
SCTP_STAT_DECR_GAUGE32(sctps_currestab);
@@ -1224,11 +1224,11 @@ sctp_fill_up_addresses(struct sctp_inpcb *inp,
{
size_t size = 0;
- SCTP_IPI_ADDR_LOCK();
+ SCTP_IPI_ADDR_RLOCK();
/* fill up addresses for the endpoint's default vrf */
size = sctp_fill_up_addresses_vrf(inp, stcb, limit, sas,
inp->def_vrf_id);
- SCTP_IPI_ADDR_UNLOCK();
+ SCTP_IPI_ADDR_RUNLOCK();
return (size);
}
@@ -1291,10 +1291,10 @@ sctp_count_max_addresses(struct sctp_inpcb *inp)
{
int cnt = 0;
- SCTP_IPI_ADDR_LOCK();
+ SCTP_IPI_ADDR_RLOCK();
/* count addresses for the endpoint's default VRF */
cnt = sctp_count_max_addresses_vrf(inp, inp->def_vrf_id);
- SCTP_IPI_ADDR_UNLOCK();
+ SCTP_IPI_ADDR_RUNLOCK();
return (cnt);
}
OpenPOWER on IntegriCloud