diff options
author | rrs <rrs@FreeBSD.org> | 2007-06-06 00:40:41 +0000 |
---|---|---|
committer | rrs <rrs@FreeBSD.org> | 2007-06-06 00:40:41 +0000 |
commit | f084c2f975a688f375554cf7ad176ceae2c5b8ba (patch) | |
tree | 7c7d9fa384c35a7415eb416b7a53f9ed02eec2d0 /sys | |
parent | 433397be886ce98eba6f388b318f8d6ede3d47a6 (diff) | |
download | FreeBSD-src-f084c2f975a688f375554cf7ad176ceae2c5b8ba.zip FreeBSD-src-f084c2f975a688f375554cf7ad176ceae2c5b8ba.tar.gz |
- Fixes a case where doing a sysctl would leave locks held
when coping out association data.
- Fixes a small bug that prevented the SCTP_UNORDERED indication
from going up to the app on a recv in the sinfo_flags field.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/sctp_sysctl.c | 11 | ||||
-rw-r--r-- | sys/netinet/sctputil.c | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index 9ee6470..c76b01f 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -192,6 +192,8 @@ copy_out_local_addresses(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct s /* neither Mac OS X nor FreeBSD support mulitple routing functions */ if ((vrf = sctp_find_vrf(inp->def_vrf_id)) == NULL) { + SCTP_INP_RUNLOCK(inp); + SCTP_INP_INFO_RUNLOCK(); return (-1); } if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) { @@ -273,11 +275,18 @@ copy_out_local_addresses(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct s } memset((void *)&xladdr, 0, sizeof(union sctp_sockstore)); xladdr.last = 1; + SCTP_INP_RUNLOCK(inp); + SCTP_INP_INFO_RUNLOCK(); error = SYSCTL_OUT(req, &xladdr, sizeof(struct xsctp_laddr)); + if (error) return (error); - else + + else { + SCTP_INP_INFO_RLOCK(); + SCTP_INP_RLOCK(inp); return (0); + } } /* diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index ab4e8aa..ee39de5 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -5027,6 +5027,9 @@ found_one: * there. */ sinfo->sinfo_flags &= 0x00ff; + if ((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) { + sinfo->sinfo_flags |= SCTP_UNORDERED; + } } if (fromlen && from) { struct sockaddr *to; |