Source-Changes-HG archive

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

[src/trunk]: src/sys/sys Add a KASSERT, we want M_PKTHDR.



details:   https://anonhg.NetBSD.org/src/rev/15a6abe9e092
branches:  trunk
changeset: 322002:15a6abe9e092
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Apr 13 08:44:41 2018 +0000

description:
Add a KASSERT, we want M_PKTHDR.

diffstat:

 sys/sys/mbuf.h |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r 35fb14a16d18 -r 15a6abe9e092 sys/sys/mbuf.h
--- a/sys/sys/mbuf.h    Fri Apr 13 08:12:51 2018 +0000
+++ b/sys/sys/mbuf.h    Fri Apr 13 08:44:41 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mbuf.h,v 1.184 2018/04/13 07:36:11 maxv Exp $  */
+/*     $NetBSD: mbuf.h,v 1.185 2018/04/13 08:44:41 maxv Exp $  */
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -585,6 +585,7 @@
  */
 #define        M_COPY_PKTHDR(to, from)                                         \
 do {                                                                   \
+       KASSERT(((from)->m_flags & M_PKTHDR) != 0);                     \
        (to)->m_pkthdr = (from)->m_pkthdr;                              \
        (to)->m_flags = (from)->m_flags & M_COPYFLAGS;                  \
        SLIST_INIT(&(to)->m_pkthdr.tags);                               \



Home | Main Index | Thread Index | Old Index