Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/netbsd32 Do not use a userland pointer, but the c...



details:   https://anonhg.NetBSD.org/src/rev/60e4b35d2d13
branches:  trunk
changeset: 781096:60e4b35d2d13
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Aug 18 15:25:15 2012 +0000

description:
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.

diffstat:

 sys/compat/netbsd32/netbsd32_socket.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 87de25a532d8 -r 60e4b35d2d13 sys/compat/netbsd32/netbsd32_socket.c
--- a/sys/compat/netbsd32/netbsd32_socket.c     Sat Aug 18 15:04:53 2012 +0000
+++ b/sys/compat/netbsd32/netbsd32_socket.c     Sat Aug 18 15:25:15 2012 +0000
@@ -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 @@
 
                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) {



Home | Main Index | Thread Index | Old Index