Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Oct 2015 12:40:00 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r288990 - head/sys/kern
Message-ID:  <201510071240.t97Ce0dw014059@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Wed Oct  7 12:40:00 2015
New Revision: 288990
URL: https://svnweb.freebsd.org/changeset/base/288990

Log:
  Fix regression from r248371. We need to copy packet header to new
  mbuf. Unlike in the pre-r248371 code, assert that M_PKTHDR is set
  only on a first mbuf.
  
  Reported & tested by:	Andriy Voskoboinyk <s3erios gmail.com>
  Sponsored by:		Nginx, Inc.

Modified:
  head/sys/kern/uipc_mbuf.c

Modified: head/sys/kern/uipc_mbuf.c
==============================================================================
--- head/sys/kern/uipc_mbuf.c	Wed Oct  7 12:36:28 2015	(r288989)
+++ head/sys/kern/uipc_mbuf.c	Wed Oct  7 12:40:00 2015	(r288990)
@@ -1867,6 +1867,11 @@ m_unshare(struct mbuf *m0, int how)
 			m_freem(m0);
 			return (NULL);
 		}
+		if (m->m_flags & M_PKTHDR) {
+			KASSERT(mprev == NULL, ("%s: m0 %p, m %p has M_PKTHDR",
+			    __func__, m0, m));
+			m_move_pkthdr(n, m);
+		}
 		len = m->m_len;
 		off = 0;
 		mfirst = n;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510071240.t97Ce0dw014059>