Fixes the MSG_PEEK for sctp_generic_recvmsg() the msg_flags

were not being copied in properly so PEEK and any other
msg_flags input operation were not being performed right.
Approved by:	gnn
This commit is contained in:
Randall Stewart 2007-01-24 12:59:56 +00:00
parent c4758f8e7f
commit 6dbde03086

View File

@ -2648,7 +2648,7 @@ sctp_generic_recvmsg(td, uap)
struct file *fp;
struct sockaddr *fromsa;
int fromlen;
int len, i, msg_flags = 0;
int len, i, msg_flags;
int error = 0;
#ifdef KTRACE
struct uio *ktruio = NULL;
@ -2682,7 +2682,14 @@ sctp_generic_recvmsg(td, uap)
} else {
fromlen = 0;
}
if(uap->msg_flags) {
error = copyin(uap->msg_flags, &msg_flags, sizeof (int));
if (error) {
goto out;
}
} else {
msg_flags = 0;
}
auio.uio_iov = iov;
auio.uio_iovcnt = uap->iovlen;
auio.uio_segflg = UIO_USERSPACE;
@ -2699,6 +2706,7 @@ sctp_generic_recvmsg(td, uap)
}
len = auio.uio_resid;
fromsa = (struct sockaddr *)sockbufstore;
#ifdef KTRACE
if (KTRPOINT(td, KTR_GENIO))
ktruio = cloneuio(&auio);