Module Name:    src
Committed By:   riz
Date:           Thu Jul 12 17:11:17 UTC 2012

Modified Files:
        src/sys/kern [netbsd-6]: uipc_socket.c

Log Message:
Pull up following revision(s) (requested by chs in ticket #408):
        sys/kern/uipc_socket.c: revision 1.211
in soreceive(), handle uios larger than 31 bits.
fixes the remaining problem in PR 43240.


To generate a diff of this commit:
cvs rdiff -u -r1.209 -r1.209.2.1 src/sys/kern/uipc_socket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/uipc_socket.c
diff -u src/sys/kern/uipc_socket.c:1.209 src/sys/kern/uipc_socket.c:1.209.2.1
--- src/sys/kern/uipc_socket.c:1.209	Wed Feb  1 02:27:23 2012
+++ src/sys/kern/uipc_socket.c	Thu Jul 12 17:11:17 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket.c,v 1.209 2012/02/01 02:27:23 matt Exp $	*/
+/*	$NetBSD: uipc_socket.c,v 1.209.2.1 2012/07/12 17:11:17 riz Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.209 2012/02/01 02:27:23 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.209.2.1 2012/07/12 17:11:17 riz Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_sock_counters.h"
@@ -1132,7 +1132,8 @@ soreceive(struct socket *so, struct mbuf
 {
 	struct lwp *l = curlwp;
 	struct mbuf	*m, **mp, *mt;
-	int atomic, flags, len, error, s, offset, moff, type, orig_resid;
+	size_t len, offset, moff, orig_resid;
+	int atomic, flags, error, s, type;
 	const struct protosw	*pr;
 	struct mbuf	*nextrecord;
 	int		mbuf_removed = 0;
@@ -1165,7 +1166,7 @@ soreceive(struct socket *so, struct mbuf
 			goto bad;
 		do {
 			error = uiomove(mtod(m, void *),
-			    (int) min(uio->uio_resid, m->m_len), uio);
+			    MIN(uio->uio_resid, m->m_len), uio);
 			m = m_free(m);
 		} while (uio->uio_resid > 0 && error == 0 && m);
  bad:
@@ -1419,7 +1420,7 @@ soreceive(struct socket *so, struct mbuf
 			SBLASTMBUFCHK(&so->so_rcv, "soreceive uiomove");
 			sounlock(so);
 			splx(s);
-			error = uiomove(mtod(m, char *) + moff, (int)len, uio);
+			error = uiomove(mtod(m, char *) + moff, len, uio);
 			s = splsoftnet();
 			solock(so);
 			if (error != 0) {

Reply via email to