mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-31 16:57:10 +00:00
Make sbcompress use the new M_WRITABLE macro. Previously sbcompress
could not compress into clusters. This could result in lots of wasted clusters while recieving small packets from an interface that uses clusters for all it's packets. Patch is partially from BSDi (limiting the size of the copy) and based on a patch for 4.1 by Ian Dowse <iedowse@maths.tcd.ie> and myself. Reviewed by: bmilekic Obtained From: BSDi Submitted by: iedowse
This commit is contained in:
parent
09980f4348
commit
32af0d74f0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=68918
@ -718,8 +718,10 @@ sbcompress(sb, m, n)
|
||||
m = m_free(m);
|
||||
continue;
|
||||
}
|
||||
if (n && (n->m_flags & (M_EXT | M_EOR)) == 0 &&
|
||||
(n->m_data + n->m_len + m->m_len) < &n->m_dat[MLEN] &&
|
||||
if (n && (n->m_flags & M_EOR) == 0 &&
|
||||
M_WRITABLE(n) &&
|
||||
m->m_len <= MCLBYTES / 4 && /* XXX: Don't copy too much */
|
||||
m->m_len <= M_TRAILINGSPACE(n) &&
|
||||
n->m_type == m->m_type) {
|
||||
bcopy(mtod(m, caddr_t), mtod(n, caddr_t) + n->m_len,
|
||||
(unsigned)m->m_len);
|
||||
|
@ -718,8 +718,10 @@ sbcompress(sb, m, n)
|
||||
m = m_free(m);
|
||||
continue;
|
||||
}
|
||||
if (n && (n->m_flags & (M_EXT | M_EOR)) == 0 &&
|
||||
(n->m_data + n->m_len + m->m_len) < &n->m_dat[MLEN] &&
|
||||
if (n && (n->m_flags & M_EOR) == 0 &&
|
||||
M_WRITABLE(n) &&
|
||||
m->m_len <= MCLBYTES / 4 && /* XXX: Don't copy too much */
|
||||
m->m_len <= M_TRAILINGSPACE(n) &&
|
||||
n->m_type == m->m_type) {
|
||||
bcopy(mtod(m, caddr_t), mtod(n, caddr_t) + n->m_len,
|
||||
(unsigned)m->m_len);
|
||||
|
Loading…
Reference in New Issue
Block a user