If we fail to allocate a cluster to hold a large packet, simply

drop it rather than using a chain of tiny mbufs.
Do not force the initial part of a packet into a separate mbuf.
This commit is contained in:
mycroft 1997-04-24 02:36:46 +00:00
parent 68258fba20
commit b65e62c6c4
2 changed files with 14 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_se.c,v 1.5 1997/04/04 19:02:43 matthias Exp $ */
/* $NetBSD: if_se.c,v 1.6 1997/04/24 02:36:46 mycroft Exp $ */
/*
* Copyright (c) 1997 Ian W. Dall <ian.dall@dsto.defence.gov.au>
@ -578,10 +578,13 @@ se_get(sc, data, totlen)
}
len = MLEN;
}
if (top && totlen >= MINCLSIZE) {
if (totlen >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT);
if (m->m_flags & M_EXT)
len = MCLBYTES;
if ((m->m_flags & M_EXT) == 0)
m_freem(top);
return 0;
}
len = MCLBYTES;
}
m->m_len = len = min(totlen, len);
bcopy(data, mtod(m, caddr_t), len);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_se.c,v 1.5 1997/04/04 19:02:43 matthias Exp $ */
/* $NetBSD: if_se.c,v 1.6 1997/04/24 02:36:46 mycroft Exp $ */
/*
* Copyright (c) 1997 Ian W. Dall <ian.dall@dsto.defence.gov.au>
@ -578,10 +578,13 @@ se_get(sc, data, totlen)
}
len = MLEN;
}
if (top && totlen >= MINCLSIZE) {
if (totlen >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT);
if (m->m_flags & M_EXT)
len = MCLBYTES;
if ((m->m_flags & M_EXT) == 0)
m_freem(top);
return 0;
}
len = MCLBYTES;
}
m->m_len = len = min(totlen, len);
bcopy(data, mtod(m, caddr_t), len);