Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/netbsd32 Make SCM_RIGHTS work correctly. (make s...



details:   https://anonhg.NetBSD.org/src/rev/51b08cfd4034
branches:  trunk
changeset: 780573:51b08cfd4034
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Jul 30 07:31:16 2012 +0000

description:
Make SCM_RIGHTS work correctly.  (make sure to advance m if we've completely
dealt with, the next mbuf (if any) comes into play).

diffstat:

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

diffs (36 lines):

diff -r af7d66787e1f -r 51b08cfd4034 sys/compat/netbsd32/netbsd32_socket.c
--- a/sys/compat/netbsd32/netbsd32_socket.c     Mon Jul 30 00:56:01 2012 +0000
+++ b/sys/compat/netbsd32/netbsd32_socket.c     Mon Jul 30 07:31:16 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_socket.c,v 1.39 2012/01/20 14:08:07 joerg Exp $       */
+/*     $NetBSD: netbsd32_socket.c,v 1.40 2012/07/30 07:31:16 matt 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.39 2012/01/20 14:08:07 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.40 2012/07/30 07:31:16 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -138,7 +138,7 @@
 
        q = (char *)mp->msg_control;
 
-       for (m = control; m != NULL; m = m->m_next) {
+       for (m = control; len > 0 && m != NULL; m = m->m_next) {
                error = copyout32_msg_control_mbuf(l, mp, &len, m, &q, &truncated);
                if (truncated) {
                        m = control;
@@ -146,8 +146,6 @@
                }
                if (error)
                        break;
-               if (len <= 0)
-                       break;
        }
 
        free_control_mbuf(l, control, m);



Home | Main Index | Thread Index | Old Index