summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/sctp6_usrreq.c
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2007-06-02 11:05:08 +0000
committerrrs <rrs@FreeBSD.org>2007-06-02 11:05:08 +0000
commit18555b3d48ec06d96b44fa98539c6db54196054e (patch)
treec18f72f2ca85c02cfe7e378a329a507d80f9907b /sys/netinet6/sctp6_usrreq.c
parentc5c0761a84c2231d37094c3bc212e67e381f5fe0 (diff)
downloadFreeBSD-src-18555b3d48ec06d96b44fa98539c6db54196054e.zip
FreeBSD-src-18555b3d48ec06d96b44fa98539c6db54196054e.tar.gz
- fix initial pcb vrf setting when the initial vrf is not the
default_vrf_id - Missing lock/unlock of inp added as well in the v6 side. - IFN hash table moves to sctppcbinfo since indexes are unique across systems (including different VRFs) this makes it easier to do ifn lookups.
Diffstat (limited to 'sys/netinet6/sctp6_usrreq.c')
-rw-r--r--sys/netinet6/sctp6_usrreq.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c
index cf8df3a..f7ad987 100644
--- a/sys/netinet6/sctp6_usrreq.c
+++ b/sys/netinet6/sctp6_usrreq.c
@@ -543,6 +543,7 @@ sctp6_attach(struct socket *so, int proto, struct thread *p)
struct in6pcb *inp6;
int error;
struct sctp_inpcb *inp;
+ uint32_t vrf_id = SCTP_DEFAULT_VRFID;
inp = (struct sctp_inpcb *)so->so_pcb;
if (inp != NULL)
@@ -553,10 +554,11 @@ sctp6_attach(struct socket *so, int proto, struct thread *p)
if (error)
return error;
}
- error = sctp_inpcb_alloc(so);
+ error = sctp_inpcb_alloc(so, vrf_id);
if (error)
return error;
inp = (struct sctp_inpcb *)so->so_pcb;
+ SCTP_INP_WLOCK(inp);
inp->sctp_flags |= SCTP_PCB_FLAGS_BOUND_V6; /* I'm v6! */
inp6 = (struct in6pcb *)inp;
@@ -575,6 +577,7 @@ sctp6_attach(struct socket *so, int proto, struct thread *p)
* Hmm what about the IPSEC stuff that is missing here but in
* sctp_attach()?
*/
+ SCTP_INP_WUNLOCK(inp);
return 0;
}
OpenPOWER on IntegriCloud