diff options
author | tuexen <tuexen@FreeBSD.org> | 2009-09-19 14:02:16 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2009-09-19 14:02:16 +0000 |
commit | de3c71bd61d49aee290e55fe5415716bde0ec4f5 (patch) | |
tree | 7f9566e6fb4d8936c10c66c1a1768017e22def37 /sys/kern/uipc_syscalls.c | |
parent | b5cc6d26583c826010729266142444af8b80a58f (diff) | |
download | FreeBSD-src-de3c71bd61d49aee290e55fe5415716bde0ec4f5.zip FreeBSD-src-de3c71bd61d49aee290e55fe5415716bde0ec4f5.tar.gz |
Get SCTP working in combination with VIMAGE.
Contains code from bz.
Approved by: rrs (mentor)
MFC after: 1 month.
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r-- | sys/kern/uipc_syscalls.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 9717679..34eaf20 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include <sys/fcntl.h> #include <sys/file.h> #include <sys/filio.h> +#include <sys/jail.h> #include <sys/mount.h> #include <sys/mbuf.h> #include <sys/protosw.h> @@ -2316,6 +2317,7 @@ sctp_peeloff(td, uap) goto done; td->td_retval[0] = fd; + CURVNET_SET(head->so_vnet); so = sonewconn(head, SS_ISCONNECTED); if (so == NULL) goto noconnection; @@ -2355,6 +2357,7 @@ noconnection: /* * Release explicitly held references before returning. */ + CURVNET_RESTORE(); done: if (nfp != NULL) fdrop(nfp, td); @@ -2433,9 +2436,11 @@ sctp_generic_sendmsg (td, uap) auio.uio_offset = 0; /* XXX */ auio.uio_resid = 0; len = auio.uio_resid = uap->mlen; + CURVNET_SET(so->so_vnet); error = sctp_lower_sosend(so, to, &auio, (struct mbuf *)NULL, (struct mbuf *)NULL, uap->flags, use_rcvinfo, u_sinfo, td); + CURVNET_RESTORE(); if (error) { if (auio.uio_resid != len && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) @@ -2543,9 +2548,11 @@ sctp_generic_sendmsg_iov(td, uap) } } len = auio.uio_resid; + CURVNET_SET(so->so_vnet); error = sctp_lower_sosend(so, to, &auio, (struct mbuf *)NULL, (struct mbuf *)NULL, uap->flags, use_rcvinfo, u_sinfo, td); + CURVNET_RESTORE(); if (error) { if (auio.uio_resid != len && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) @@ -2665,9 +2672,11 @@ sctp_generic_recvmsg(td, uap) if (KTRPOINT(td, KTR_GENIO)) ktruio = cloneuio(&auio); #endif /* KTRACE */ + CURVNET_SET(so->so_vnet); error = sctp_sorecvmsg(so, &auio, (struct mbuf **)NULL, fromsa, fromlen, &msg_flags, (struct sctp_sndrcvinfo *)&sinfo, 1); + CURVNET_RESTORE(); if (error) { if (auio.uio_resid != (int)len && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) |