Module Name: src Committed By: maxv Date: Mon May 7 09:57:37 UTC 2018
Modified Files: src/sys/kern: uipc_mbuf.c Log Message: Copy some KASSERTs from m_move_pkthdr into m_copy_pkthdr, and reorder the latter to reduce the diff with the former. To generate a diff of this commit: cvs rdiff -u -r1.214 -r1.215 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.214 src/sys/kern/uipc_mbuf.c:1.215 --- src/sys/kern/uipc_mbuf.c:1.214 Thu May 3 07:46:17 2018 +++ src/sys/kern/uipc_mbuf.c Mon May 7 09:57:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_mbuf.c,v 1.214 2018/05/03 07:46:17 maxv Exp $ */ +/* $NetBSD: uipc_mbuf.c,v 1.215 2018/05/07 09:57:37 maxv 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.214 2018/05/03 07:46:17 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.215 2018/05/07 09:57:37 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_mbuftrace.h" @@ -1546,19 +1546,21 @@ m_remove_pkthdr(struct mbuf *m) void m_copy_pkthdr(struct mbuf *to, struct mbuf *from) { + KASSERT((to->m_flags & M_EXT) == 0); + KASSERT((to->m_flags & M_PKTHDR) == 0 || m_tag_first(to) == NULL); KASSERT((from->m_flags & M_PKTHDR) != 0); to->m_pkthdr = from->m_pkthdr; to->m_flags = from->m_flags & M_COPYFLAGS; + to->m_data = to->m_pktdat; + SLIST_INIT(&to->m_pkthdr.tags); m_tag_copy_chain(to, from); - to->m_data = to->m_pktdat; } void m_move_pkthdr(struct mbuf *to, struct mbuf *from) { - KASSERT((to->m_flags & M_EXT) == 0); KASSERT((to->m_flags & M_PKTHDR) == 0 || m_tag_first(to) == NULL); KASSERT((from->m_flags & M_PKTHDR) != 0);