Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys/kern Pull up following revision(s) (requested by mlel...
details: https://anonhg.NetBSD.org/src/rev/ded497f931ef
branches: netbsd-7
changeset: 798969:ded497f931ef
user: martin <martin%NetBSD.org@localhost>
date: Mon Feb 09 09:46:01 2015 +0000
description:
Pull up following revision(s) (requested by mlelstv in ticket #501):
sys/kern/uipc_mbuf.c: revision 1.161
Correct m_len calculation for m_dup() with mbuf clusters.
Fixes kern/49650.
diffstat:
sys/kern/uipc_mbuf.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diffs (32 lines):
diff -r 1e806565925c -r ded497f931ef sys/kern/uipc_mbuf.c
--- a/sys/kern/uipc_mbuf.c Mon Feb 09 09:43:09 2015 +0000
+++ b/sys/kern/uipc_mbuf.c Mon Feb 09 09:46:01 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_mbuf.c,v 1.158 2014/02/25 18:30:11 pooka Exp $ */
+/* $NetBSD: uipc_mbuf.c,v 1.158.4.1 2015/02/09 09:46:01 martin 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.158 2014/02/25 18:30:11 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.158.4.1 2015/02/09 09:46:01 martin Exp $");
#include "opt_mbuftrace.h"
#include "opt_nmbclusters.h"
@@ -777,8 +777,13 @@
/*
* we are unsure about the way m was allocated.
* copy into multiple MCLBYTES cluster mbufs.
+ *
+ * recompute m_len, it is no longer valid if MCLGET()
+ * fails to allocate a cluster. Then we try to split
+ * the source into normal sized mbufs.
*/
MCLGET(n, wait);
+ n->m_len = 0;
n->m_len = M_TRAILINGSPACE(n);
n->m_len = m_copylen(len, n->m_len);
n->m_len = min(n->m_len, m->m_len - off);
Home |
Main Index |
Thread Index |
Old Index