Module Name:    src
Committed By:   martin
Date:           Tue May 22 17:50:27 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by maxv in ticket #833):

        sys/kern/uipc_mbuf.c: revision 1.214

Revert my rev1.190, remove the M_READONLY check. The initial code was
correct: what is read-only is the mbuf storage, not the mbuf itself. The
storage contains the packet payload, and never has anything related to
mbufs. So it is fine to remove M_PKTHDR on mbufs that have a read-only
storage.

In fact it was kind of obvious, since several places already manually
remove M_PKTHDR without taking care of the external storage.


To generate a diff of this commit:
cvs rdiff -u -r1.172.6.4 -r1.172.6.5 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.172.6.4 src/sys/kern/uipc_mbuf.c:1.172.6.5
--- src/sys/kern/uipc_mbuf.c:1.172.6.4	Sun May  6 09:20:43 2018
+++ src/sys/kern/uipc_mbuf.c	Tue May 22 17:50:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.172.6.4 2018/05/06 09:20:43 martin Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.172.6.5 2018/05/22 17:50:27 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.172.6.4 2018/05/06 09:20:43 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.172.6.5 2018/05/22 17:50:27 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -460,11 +460,6 @@ m_pkthdr_remove(struct mbuf *m)
 {
 	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));

Reply via email to