aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2015-01-06 12:59:37 +0000
committerRobert Watson <rwatson@FreeBSD.org>2015-01-06 12:59:37 +0000
commit2a8c860fe3f3bcfc6ba9206f34d067d998d89c7e (patch)
tree8da641e0473d723ab1cc2e5a5772cb1eed6e4d6f /sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
parentfe657d68f54b7ef837aa6373bb9644911a074c8d (diff)
downloadsrc-2a8c860fe3f3bcfc6ba9206f34d067d998d89c7e.tar.gz
src-2a8c860fe3f3bcfc6ba9206f34d067d998d89c7e.zip
In order to reduce use of M_EXT outside of the mbuf allocator and
socket-buffer implementations, introduce a return value for MCLGET() (and m_cljget() that underlies it) to allow the caller to avoid testing M_EXT itself. Update all callers to use the return value. With this change, very few network device drivers remain aware of M_EXT; the primary exceptions lie in mbuf-chain pretty printers for debugging, and in a few cases, custom mbuf and cluster allocation implementations. NB: This is a difficult-to-test change as it touches many drivers for which I don't have physical devices. Instead we've gone for intensive review, but further post-commit review would definitely be appreciated to spot errors where changes could not easily be made mechanically, but were largely mechanical in nature. Differential Revision: https://reviews.freebsd.org/D1440 Reviewed by: adrian, bz, gnn Sponsored by: EMC / Isilon Storage Division
Notes
Notes: svn path=/head/; revision=276750
Diffstat (limited to 'sys/contrib/ipfilter/netinet/ip_fil_freebsd.c')
-rw-r--r--sys/contrib/ipfilter/netinet/ip_fil_freebsd.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
index 8f8cb0840844..551556186127 100644
--- a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
+++ b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
@@ -386,8 +386,7 @@ ipf_send_reset(fin)
if (m == NULL)
return -1;
if (sizeof(*tcp2) + hlen > MLEN) {
- MCLGET(m, M_NOWAIT);
- if ((m->m_flags & M_EXT) == 0) {
+ if (!(MCLGET(m, M_NOWAIT))) {
FREE_MB_T(m);
return -1;
}
@@ -610,8 +609,7 @@ ipf_send_icmp_err(type, fin, dst)
code = icmptoicmp6unreach[code];
if (iclen + max_linkhdr + fin->fin_plen > avail) {
- MCLGET(m, M_NOWAIT);
- if ((m->m_flags & M_EXT) == 0) {
+ if (!(MCLGET(m, M_NOWAIT))) {
FREE_MB_T(m);
return -1;
}