Do not use a userland pointer, but the copied-in kernel version instead.
While there, reorder loop end condition for efficency. Fixes net/fdpass tests on all archs with separate kernel/userland VA.
This commit is contained in:
parent
ad728d4784
commit
53ae4e4337
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: netbsd32_socket.c,v 1.40 2012/07/30 07:31:16 matt Exp $ */
|
||||
/* $NetBSD: netbsd32_socket.c,v 1.41 2012/08/18 15:25:15 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998, 2001 Matthew R. Green
|
||||
@ -27,7 +27,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.40 2012/07/30 07:31:16 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.41 2012/08/18 15:25:15 martin Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -296,7 +296,7 @@ copyin32_msg_control(struct lwp *l, struct msghdr *mp)
|
||||
|
||||
resid -= CMSG32_ALIGN(cmsg32.cmsg_len);
|
||||
cidx += cmsg->cmsg_len;
|
||||
} while ((cc = CMSG32_NXTHDR(mp, cc)) && resid > 0);
|
||||
} while (resid > 0 && (cc = CMSG32_NXTHDR(mp, &cmsg32)));
|
||||
|
||||
/* If we allocated a buffer, attach to mbuf */
|
||||
if (cidx > MLEN) {
|
||||
|
Loading…
Reference in New Issue
Block a user