summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2008-01-28 10:34:38 +0000
committerrrs <rrs@FreeBSD.org>2008-01-28 10:34:38 +0000
commitce5fec50e4e565038b7bdb6ea20783cc6d4233b6 (patch)
tree367fb02dd652e9668be27349f3761fbc3b59374d /sys/netinet
parentdbf34dbcc64350bbb2ef057d4c25ae74aaba6f04 (diff)
downloadFreeBSD-src-ce5fec50e4e565038b7bdb6ea20783cc6d4233b6.zip
FreeBSD-src-ce5fec50e4e565038b7bdb6ea20783cc6d4233b6.tar.gz
- Fix a comment about prison.
- Fix it so the VRF is captured while locks are held. MFC after: 1 week
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/sctp_pcb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index fef23bf..0d03637 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -2429,8 +2429,9 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *addr,
if (prison) {
/*
* For INADDR_ANY and LOOPBACK the
- * prison_ip() call will tranmute the ip
- * address to the proper valie.
+ * prison_ip() call will transmute the ip
+ * address to the proper value (i.e. the IP
+ * address owned by the jail).
*/
if (prison_ip(p->td_ucred, 0, &sin->sin_addr.s_addr)) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL);
@@ -2471,11 +2472,11 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *addr,
return (EAFNOSUPPORT);
}
}
+ SCTP_INP_INFO_WLOCK();
+ SCTP_INP_WLOCK(inp);
/* Setup a vrf_id to be the default for the non-bind-all case. */
vrf_id = inp->def_vrf_id;
- SCTP_INP_INFO_WLOCK();
- SCTP_INP_WLOCK(inp);
/* increase our count due to the unlock we do */
SCTP_INP_INCR_REF(inp);
if (lport) {
OpenPOWER on IntegriCloud