Date: Wed, 30 Jan 2013 18:40:19 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246130 - head/sys/netinet/libalias Message-ID: <201301301840.r0UIeJnW043560@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Wed Jan 30 18:40:19 2013 New Revision: 246130 URL: http://svnweb.freebsd.org/changeset/base/246130 Log: Utilize m_get2() to get mbuf of appropriate size. Modified: head/sys/netinet/libalias/alias.c Modified: head/sys/netinet/libalias/alias.c ============================================================================== --- head/sys/netinet/libalias/alias.c Wed Jan 30 18:24:29 2013 (r246129) +++ head/sys/netinet/libalias/alias.c Wed Jan 30 18:40:19 2013 (r246130) @@ -1760,21 +1760,7 @@ m_megapullup(struct mbuf *m, int len) { if (m->m_next == NULL && M_WRITABLE(m) && M_TRAILINGSPACE(m) >= RESERVE) return (m); - if (len <= MCLBYTES - RESERVE) { - mcl = m_getcl(M_NOWAIT, 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_NOWAIT, MT_DATA, M_PKTHDR, size); - } else { - goto bad; - } + mcl = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR, len + RESERVE); if (mcl == NULL) goto bad;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301301840.r0UIeJnW043560>