summaryrefslogtreecommitdiff
path: root/sys/dev/pci/hifn7751.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2000-06-13 02:22:51 +0000
committerJason Wright <jason@cvs.openbsd.org>2000-06-13 02:22:51 +0000
commit6e274593757db3e32991b92a21cdd60081006e3d (patch)
tree110fc7e1820220db09dd2c638494ca547bc8e45b /sys/dev/pci/hifn7751.c
parent0eec1fa1400cbcb70e942315aa1fad3aa4020f28 (diff)
Be more careful when setting up the mbufs for destination buffers
(similiar to what's in ubsec)
Diffstat (limited to 'sys/dev/pci/hifn7751.c')
-rw-r--r--sys/dev/pci/hifn7751.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c
index b543e949f82..ff725ebad0d 100644
--- a/sys/dev/pci/hifn7751.c
+++ b/sys/dev/pci/hifn7751.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hifn7751.c,v 1.39 2000/06/02 22:36:44 deraadt Exp $ */
+/* $OpenBSD: hifn7751.c,v 1.40 2000/06/13 02:22:50 jason Exp $ */
/*
* Invertex AEON / Hi/fn 7751 driver
@@ -841,11 +841,16 @@ hifn_crypto(sc, cmd)
struct mbuf *m, *top, **mp;
totlen = cmd->dst_l = cmd->src_l;
- MGETHDR(m, M_DONTWAIT, MT_DATA);
- M_COPY_PKTHDR(m, cmd->src_m);
+ if (cmd->src_m->m_flags & M_PKTHDR) {
+ MGETHDR(m, M_DONTWAIT, MT_DATA);
+ M_COPY_PKTHDR(m, cmd->src_m);
+ len = MHLEN;
+ } else {
+ MGET(m, M_DONTWAIT, MT_DATA);
+ len = MLEN;
+ }
if (m == NULL)
return (-1);
- len = MHLEN;
if (totlen >= MINCLSIZE) {
MCLGET(m, M_DONTWAIT);
if (m->m_flags & M_EXT)