mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-06 13:09:50 +00:00
Utilize m_get2() to get mbuf of appropriate size.
This commit is contained in:
parent
2d5d7a0c83
commit
ea26ed7eea
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=246130
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user