summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/netinet/libalias/alias.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/netinet/libalias/alias.c')
-rw-r--r--freebsd/sys/netinet/libalias/alias.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/freebsd/sys/netinet/libalias/alias.c b/freebsd/sys/netinet/libalias/alias.c
index 9e975122..a2cd987c 100644
--- a/freebsd/sys/netinet/libalias/alias.c
+++ b/freebsd/sys/netinet/libalias/alias.c
@@ -1724,7 +1724,7 @@ LibAliasUnLoadAllModule(void)
/* Unload all modules then reload everything. */
while ((p = first_handler()) != NULL) {
- detach_handler(p);
+ LibAliasDetachHandlers(p);
}
while ((t = walk_dll_chain()) != NULL) {
dlclose(t->handle);
@@ -1751,40 +1751,22 @@ LibAliasUnLoadAllModule(void)
struct mbuf *
m_megapullup(struct mbuf *m, int len) {
struct mbuf *mcl;
-
+
if (len > m->m_pkthdr.len)
goto bad;
-
- /* Do not reallocate packet if it is sequentional,
- * writable and has some extra space for expansion.
- * XXX: Constant 100bytes is completely empirical. */
-#define RESERVE 100
- if (m->m_next == NULL && M_WRITABLE(m) && M_TRAILINGSPACE(m) >= RESERVE)
+
+ if (m->m_next == NULL && M_WRITABLE(m))
return (m);
- if (len <= MCLBYTES - RESERVE) {
- mcl = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
- } else if (len < MJUM16BYTES) {
- int size;
- if (len <= MJUMPAGESIZE - RESERVE) {
- size = MJUMPAGESIZE;
- } else if (len <= MJUM9BYTES - RESERVE) {
- size = MJUM9BYTES;
- } else {
- size = MJUM16BYTES;
- };
- mcl = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, size);
- } else {
- goto bad;
- }
+ mcl = m_get2(len, M_NOWAIT, MT_DATA, M_PKTHDR);
if (mcl == NULL)
goto bad;
-
+ m_align(mcl, len);
m_move_pkthdr(mcl, m);
m_copydata(m, 0, len, mtod(mcl, caddr_t));
mcl->m_len = mcl->m_pkthdr.len = len;
m_freem(m);
-
+
return (mcl);
bad:
m_freem(m);