summaryrefslogtreecommitdiff
path: root/sys/netinet/sctp_sysctl.c
diff options
context:
space:
mode:
authorRandall Stewart <rrs@FreeBSD.org>2007-06-06 00:40:41 +0000
committerRandall Stewart <rrs@FreeBSD.org>2007-06-06 00:40:41 +0000
commit5f26a41d17fad72b906fba72abcf986439bf3a22 (patch)
tree7c7d9fa384c35a7415eb416b7a53f9ed02eec2d0 /sys/netinet/sctp_sysctl.c
parent34a1405271c51d661671fee659266a0ebf6fcc24 (diff)
downloadsrc-test2-5f26a41d17fad72b906fba72abcf986439bf3a22.tar.gz
src-test2-5f26a41d17fad72b906fba72abcf986439bf3a22.zip
Notes
Diffstat (limited to 'sys/netinet/sctp_sysctl.c')
-rw-r--r--sys/netinet/sctp_sysctl.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c
index 9ee6470eada7..c76b01f88e53 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);
+ }
}
/*