Source-Changes-HG archive

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

src: Pull up following revision(s) (requested by maxv in ticket ...



details:   https://anonhg.NetBSD.org/src/rev/8f91f4a3b0d1
branches:  netbsd-7-1
changeset: 318283:8f91f4a3b0d1
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Apr 17 08:28:55 2018 +0000
description:
Pull up following revision(s) (requested by maxv in ticket #1598):

        sys/kern/uipc_mbuf.c: revision 1.190

If the mbuf is shared leave M_PKTHDR in place. Given where this function
is called from that's not supposed to happen, but I'm growing unconfident
about our mbuf code.

diffstat:

 sys/kern/uipc_mbuf.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r e0fc80680ba9 -r 8f91f4a3b0d1 sys/kern/uipc_mbuf.c
--- a/sys/kern/uipc_mbuf.c      Tue Apr 10 11:18:02 2018 +0000
+++ b/sys/kern/uipc_mbuf.c      Tue Apr 17 08:28:55 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_mbuf.c,v 1.158.4.1.6.1 2018/04/05 11:50:17 martin Exp $   */
+/*     $NetBSD: uipc_mbuf.c,v 1.158.4.1.6.2 2018/04/17 08:28:55 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.4.1.6.1 2018/04/05 11:50:17 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.158.4.1.6.2 2018/04/17 08:28:55 martin Exp $");
 
 #include "opt_mbuftrace.h"
 #include "opt_nmbclusters.h"
@@ -458,6 +458,11 @@
 {
        KASSERT(m->m_flags & M_PKTHDR);
 
+       if (M_READONLY(m)) {
+               /* Nothing we can do. */
+               return;
+       }
+
        m_tag_delete_chain(m, NULL);
        m->m_flags &= ~M_PKTHDR;
        memset(&m->m_pkthdr, 0, sizeof(m->m_pkthdr));



Home | Main Index | Thread Index | Old Index