svn commit: r248887 - head/sys/kern
Gleb Smirnoff
glebius at FreeBSD.org
Fri Mar 29 14:10:40 UTC 2013
Author: glebius
Date: Fri Mar 29 14:10:40 2013
New Revision: 248887
URL: http://svnweb.freebsd.org/changeset/base/248887
Log:
Fix bug in m_split() in a case when split len matches len of the
first mbuf, and the first mbuf is M_PKTHDR.
PR: kern/176144
Submitted by: Jacques Fourie <jacques.fourie gmail.com>
Modified:
head/sys/kern/uipc_mbuf.c
Modified: head/sys/kern/uipc_mbuf.c
==============================================================================
--- head/sys/kern/uipc_mbuf.c Fri Mar 29 14:06:04 2013 (r248886)
+++ head/sys/kern/uipc_mbuf.c Fri Mar 29 14:10:40 2013 (r248887)
@@ -1197,7 +1197,16 @@ m_split(struct mbuf *m0, int len0, int w
if (m == NULL)
return (NULL);
remain = m->m_len - len;
- if (m0->m_flags & M_PKTHDR) {
+ if (m0->m_flags & M_PKTHDR && remain == 0) {
+ n = m_gethdr(wait, m0->m_type);
+ return (NULL);
+ n->m_next = m->m_next;
+ m->m_next = NULL;
+ n->m_pkthdr.rcvif = m0->m_pkthdr.rcvif;
+ n->m_pkthdr.len = m0->m_pkthdr.len - len0;
+ m0->m_pkthdr.len = len0;
+ return (n);
+ } else if (m0->m_flags & M_PKTHDR) {
n = m_gethdr(wait, m0->m_type);
if (n == NULL)
return (NULL);
More information about the svn-src-head
mailing list