Substitute flags from historical mbuf(9) allocator with modern ones.
Sponsored by: Nginx, Inc.
This commit is contained in:
parent
876fa2c17b
commit
8327c83319
@ -543,7 +543,7 @@ MALLOC_DECLARE(M_IPFILTER);
|
||||
# ifndef ALLOC_MB_T
|
||||
# ifdef MGETHDR
|
||||
# define ALLOC_MB_T(m,l) do { \
|
||||
MGETHDR((m), M_DONTWAIT, MT_HEADER); \
|
||||
MGETHDR((m), M_NOWAIT, MT_HEADER); \
|
||||
if ((m) != NULL) { \
|
||||
(m)->m_len = (l); \
|
||||
(m)->m_pkthdr.len = (l); \
|
||||
@ -551,7 +551,7 @@ MALLOC_DECLARE(M_IPFILTER);
|
||||
} while (0)
|
||||
# else
|
||||
# define ALLOC_MB_T(m,l) do { \
|
||||
MGET((m), M_DONTWAIT, MT_HEADER); \
|
||||
MGET((m), M_NOWAIT, MT_HEADER); \
|
||||
if ((m) != NULL) { \
|
||||
(m)->m_len = (l); \
|
||||
(m)->m_pkthdr.len = (l); \
|
||||
|
@ -368,14 +368,14 @@ ipf_send_reset(fin)
|
||||
hlen = sizeof(ip_t);
|
||||
#endif
|
||||
#ifdef MGETHDR
|
||||
MGETHDR(m, M_DONTWAIT, MT_HEADER);
|
||||
MGETHDR(m, M_NOWAIT, MT_HEADER);
|
||||
#else
|
||||
MGET(m, M_DONTWAIT, MT_HEADER);
|
||||
MGET(m, M_NOWAIT, MT_HEADER);
|
||||
#endif
|
||||
if (m == NULL)
|
||||
return -1;
|
||||
if (sizeof(*tcp2) + hlen > MLEN) {
|
||||
MCLGET(m, M_DONTWAIT);
|
||||
MCLGET(m, M_NOWAIT);
|
||||
if ((m->m_flags & M_EXT) == 0) {
|
||||
FREE_MB_T(m);
|
||||
return -1;
|
||||
@ -543,9 +543,9 @@ ipf_send_icmp_err(type, fin, dst)
|
||||
if (ipf_checkl4sum(fin) == -1)
|
||||
return -1;
|
||||
#ifdef MGETHDR
|
||||
MGETHDR(m, M_DONTWAIT, MT_HEADER);
|
||||
MGETHDR(m, M_NOWAIT, MT_HEADER);
|
||||
#else
|
||||
MGET(m, M_DONTWAIT, MT_HEADER);
|
||||
MGET(m, M_NOWAIT, MT_HEADER);
|
||||
#endif
|
||||
if (m == NULL)
|
||||
return -1;
|
||||
@ -599,7 +599,7 @@ ipf_send_icmp_err(type, fin, dst)
|
||||
code = icmptoicmp6unreach[code];
|
||||
|
||||
if (iclen + max_linkhdr + fin->fin_plen > avail) {
|
||||
MCLGET(m, M_DONTWAIT);
|
||||
MCLGET(m, M_NOWAIT);
|
||||
if ((m->m_flags & M_EXT) == 0) {
|
||||
FREE_MB_T(m);
|
||||
return -1;
|
||||
@ -730,7 +730,7 @@ ipf_fastroute(m0, mpp, fin, fdp)
|
||||
* problem.
|
||||
*/
|
||||
if (M_WRITABLE(m) == 0) {
|
||||
m0 = m_dup(m, M_DONTWAIT);
|
||||
m0 = m_dup(m, M_NOWAIT);
|
||||
if (m0 != 0) {
|
||||
FREE_MB_T(m);
|
||||
m = m0;
|
||||
@ -878,9 +878,9 @@ ipf_fastroute(m0, mpp, fin, fdp)
|
||||
mhlen = sizeof (struct ip);
|
||||
for (off = hlen + len; off < ntohs(ip->ip_len); off += len) {
|
||||
#ifdef MGETHDR
|
||||
MGETHDR(m, M_DONTWAIT, MT_HEADER);
|
||||
MGETHDR(m, M_NOWAIT, MT_HEADER);
|
||||
#else
|
||||
MGET(m, M_DONTWAIT, MT_HEADER);
|
||||
MGET(m, M_NOWAIT, MT_HEADER);
|
||||
#endif
|
||||
if (m == 0) {
|
||||
m = m0;
|
||||
|
Loading…
Reference in New Issue
Block a user