diff options
author | 2009-08-09 11:40:56 +0000 | |
---|---|---|
committer | 2009-08-09 11:40:56 +0000 | |
commit | 415ac77a3a2772736744faf2d84ece851590666b (patch) | |
tree | 059f756f4314ab891c239f074b6c70dd4668a948 /sys/dev/pci/if_vr.c | |
parent | Initialize all the InputFieldData members correctly. Fixes a crash when (diff) | |
download | wireguard-openbsd-415ac77a3a2772736744faf2d84ece851590666b.tar.xz wireguard-openbsd-415ac77a3a2772736744faf2d84ece851590666b.zip |
MCLGETI() will now allocate a mbuf header if it is not provided, thus
reducing the amount of splnet/splx dancing required.. especially in the
worst case (of m_cldrop)
ok dlg kettenis damien
Diffstat (limited to 'sys/dev/pci/if_vr.c')
-rw-r--r-- | sys/dev/pci/if_vr.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c index 1dbe51a569e..4c961ebe1c2 100644 --- a/sys/dev/pci/if_vr.c +++ b/sys/dev/pci/if_vr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vr.c,v 1.97 2009/06/18 18:53:02 claudio Exp $ */ +/* $OpenBSD: if_vr.c,v 1.98 2009/08/09 11:40:56 deraadt Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1568,16 +1568,10 @@ vr_alloc_mbuf(struct vr_softc *sc, struct vr_chain_onefrag *r) if (r == NULL) return (EINVAL); - MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == NULL) + m = MCLGETI(NULL, M_DONTWAIT, &sc->arpcom.ac_if, MCLBYTES); + if (!m) return (ENOBUFS); - MCLGETI(m, M_DONTWAIT, &sc->arpcom.ac_if, MCLBYTES); - if (!(m->m_flags & M_EXT)) { - m_free(m); - return (ENOBUFS); - } - m->m_len = m->m_pkthdr.len = MCLBYTES; m_adj(m, sizeof(u_int64_t)); |