mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-09 16:01:19 +01:00
To obey the traditional practice in mbuf chaining.
PR: 4020 Reviewed by: hamada@astec.co.jp
This commit is contained in:
parent
34de7199ea
commit
b51da36807
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=30022
@ -850,6 +850,12 @@ vxget(sc, totlen)
|
||||
*/
|
||||
sh = splhigh();
|
||||
|
||||
/*
|
||||
* Since we don't set allowLargePackets bit in MacControl register,
|
||||
* we can assume that totlen <= 1500bytes.
|
||||
* The while loop will be performed iff we have a packet with
|
||||
* MLEN < m_len < MINCLSIZE.
|
||||
*/
|
||||
while (totlen > 0) {
|
||||
if (top) {
|
||||
m = sc->mb[sc->next_mb];
|
||||
@ -867,18 +873,17 @@ vxget(sc, totlen)
|
||||
len = MLEN;
|
||||
}
|
||||
if (totlen >= MINCLSIZE) {
|
||||
MCLGET(m, M_DONTWAIT);
|
||||
if (m->m_flags & M_EXT)
|
||||
len = MCLBYTES;
|
||||
MCLGET(m, M_DONTWAIT);
|
||||
if (m->m_flags & M_EXT)
|
||||
len = MCLBYTES;
|
||||
}
|
||||
len = min(totlen, len);
|
||||
if (len > 3) {
|
||||
len &= ~3;
|
||||
insl(BASE + VX_W1_RX_PIO_RD_1, mtod(m, u_int32_t *),
|
||||
len / 4);
|
||||
} else
|
||||
insb(BASE + VX_W1_RX_PIO_RD_1, mtod(m, u_int8_t *),
|
||||
len);
|
||||
if (len > 3)
|
||||
insl(BASE + VX_W1_RX_PIO_RD_1, mtod(m, u_int32_t *), len / 4);
|
||||
if (len & 3) {
|
||||
insb(BASE + VX_W1_RX_PIO_RD_1, mtod(m, u_int8_t *) + (len & ~3),
|
||||
len & 3);
|
||||
}
|
||||
m->m_len = len;
|
||||
totlen -= len;
|
||||
*mp = m;
|
||||
|
Loading…
Reference in New Issue
Block a user