FreeBSD Bugzilla – Attachment 160103 Details for
Bug 202482
[patch] [regression] mbuf(9): m_unshare() drops m_pkthdr after r248371
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Reverse patch for r248371
patch-uipc-mbuf.diff (text/plain), 1.67 KB, created by
Andriy Voskoboinyk
on 2015-08-19 14:28:46 UTC
(
hide
)
Description:
Reverse patch for r248371
Filename:
MIME Type:
Creator:
Andriy Voskoboinyk
Created:
2015-08-19 14:28:46 UTC
Size:
1.67 KB
patch
obsolete
>Index: sys/kern/uipc_mbuf.c >=================================================================== >--- sys/kern/uipc_mbuf.c (revision 286881) >+++ sys/kern/uipc_mbuf.c (working copy) >@@ -1858,18 +1858,43 @@ > } > > /* >- * Allocate new space to hold the copy and copy the data. >- * We deal with jumbo mbufs (i.e. m_len > MCLBYTES) by >- * splitting them into clusters. We could just malloc a >- * buffer and make it external but too many device drivers >- * don't know how to break up the non-contiguous memory when >+ * Allocate new space to hold the copy... >+ */ >+ /* XXX why can M_PKTHDR be set past the first mbuf? */ >+ if (mprev == NULL && (m->m_flags & M_PKTHDR)) { >+ /* >+ * NB: if a packet header is present we must >+ * allocate the mbuf separately from any cluster >+ * because M_MOVE_PKTHDR will smash the data >+ * pointer and drop the M_EXT marker. >+ */ >+ MGETHDR(n, how, m->m_type); >+ if (n == NULL) { >+ m_freem(m0); >+ return (NULL); >+ } >+ M_MOVE_PKTHDR(n, m); >+ MCLGET(n, how); >+ if ((n->m_flags & M_EXT) == 0) { >+ m_free(n); >+ m_freem(m0); >+ return (NULL); >+ } >+ } else { >+ n = m_getcl(how, m->m_type, m->m_flags); >+ if (n == NULL) { >+ m_freem(m0); >+ return (NULL); >+ } >+ } >+ /* >+ * ... and copy the data. We deal with jumbo mbufs >+ * (i.e. m_len > MCLBYTES) by splitting them into >+ * clusters. We could just malloc a buffer and make >+ * it external but too many device drivers don't know >+ * how to break up the non-contiguous memory when > * doing DMA. > */ >- n = m_getcl(how, m->m_type, m->m_flags); >- if (n == NULL) { >- m_freem(m0); >- return (NULL); >- } > len = m->m_len; > off = 0; > mfirst = n;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 202482
: 160103