Module Name:    src
Committed By:   snj
Date:           Tue Apr  7 23:43:16 UTC 2009

Modified Files:
        src/sys/kern [netbsd-5]: uipc_mbuf.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #674):
        sys/kern/uipc_mbuf.c: revision 1.132
m_split0(): If the newly allocated mbuf holds only the header,
don't forget to set m_len to 0. Otherwise whatever will compute the size
of this chain (including s_split() itself if called again on this chain)
will get it wrong, leading to various issues.
Bug exposed by the NFS server code with linux clients using TCP mounts.


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.128.6.1 src/sys/kern/uipc_mbuf.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_mbuf.c
diff -u src/sys/kern/uipc_mbuf.c:1.128 src/sys/kern/uipc_mbuf.c:1.128.6.1
--- src/sys/kern/uipc_mbuf.c:1.128	Wed Jul  2 14:47:34 2008
+++ src/sys/kern/uipc_mbuf.c	Tue Apr  7 23:43:16 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.128 2008/07/02 14:47:34 matt Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.128.6.1 2009/04/07 23:43:16 snj Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.128 2008/07/02 14:47:34 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.128.6.1 2009/04/07 23:43:16 snj Exp $");
 
 #include "opt_mbuftrace.h"
 #include "opt_ddb.h"
@@ -1048,6 +1048,7 @@
 		if (remain > MHLEN) {
 			/* m can't be the lead packet */
 			MH_ALIGN(n, 0);
+			n->m_len = 0;
 			n->m_next = m_split(m, len, wait);
 			if (n->m_next == 0) {
 				(void) m_free(n);

Reply via email to