X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/2d21ac55c334faf3a56e5634905ed6987fc787d4..e2fac8b15b12a7979f72090454d850e612fc5b13:/bsd/kern/uipc_mbuf.c diff --git a/bsd/kern/uipc_mbuf.c b/bsd/kern/uipc_mbuf.c index 38fe262e6..0c0a27855 100644 --- a/bsd/kern/uipc_mbuf.c +++ b/bsd/kern/uipc_mbuf.c @@ -388,7 +388,6 @@ typedef struct mcl_slab { * whenever a new piece of memory mapped in from the VM crosses the 1MB * boundary. */ -#define MBSHIFT 20 /* 1MB */ #define NSLABSPMB ((1 << MBSHIFT) >> MCLSHIFT) /* 512 slabs/grp */ typedef struct mcl_slabg { @@ -1026,7 +1025,7 @@ mbinit(void) VERIFY(slabstbl != NULL); /* Allocate audit structures if needed */ - PE_parse_boot_arg("mbuf_debug", &mbuf_debug); + PE_parse_boot_argn("mbuf_debug", &mbuf_debug, sizeof (mbuf_debug)); mbuf_debug |= mcache_getflags(); if (mbuf_debug & MCF_AUDIT) { MALLOC(mclaudit, mcl_audit_t *, @@ -1051,7 +1050,7 @@ mbinit(void) embutl = (union mcluster *) ((unsigned char *)mbutl + (nmbclusters * MCLBYTES)); - PE_parse_boot_arg("initmcl", &initmcl); + PE_parse_boot_argn("initmcl", &initmcl, sizeof (initmcl)); lck_mtx_lock(mbuf_mlock); @@ -3011,8 +3010,9 @@ m_copy_pkthdr(struct mbuf *to, struct mbuf *from) #endif /* MAC_NET */ to->m_pkthdr = from->m_pkthdr; /* especially tags */ m_tag_init(from); /* purge tags from src */ - to->m_flags = from->m_flags & M_COPYFLAGS; - to->m_data = (to)->m_pktdat; + to->m_flags = (from->m_flags & M_COPYFLAGS) | (to->m_flags & M_EXT); + if ((to->m_flags & M_EXT) == 0) + to->m_data = to->m_pktdat; } /*