summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason <jason@openbsd.org>2000-04-25 05:32:21 +0000
committerjason <jason@openbsd.org>2000-04-25 05:32:21 +0000
commit3ba456e13f5f247db2dd584520a46024a0fe654c (patch)
tree47adb816079539824fb543515a0e218cb9cc668e
parentsync unknown list with reality; minor changes. (diff)
downloadwireguard-openbsd-3ba456e13f5f247db2dd584520a46024a0fe654c.tar.xz
wireguard-openbsd-3ba456e13f5f247db2dd584520a46024a0fe654c.zip
fixing the frontend means fixing the backend too... add a countdown when
computing the length of a destination buffer in the callback since hifn always writes in multiples of 4 bytes (and AH can produce non-nice packets)
-rw-r--r--sys/dev/pci/hifn7751.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c
index 8c6459811fa..e231ceb3f46 100644
--- a/sys/dev/pci/hifn7751.c
+++ b/sys/dev/pci/hifn7751.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hifn7751.c,v 1.35 2000/04/25 04:15:34 jason Exp $ */
+/* $OpenBSD: hifn7751.c,v 1.36 2000/04/25 05:32:21 jason Exp $ */
/*
* Invertex AEON / Hi/fn 7751 driver
@@ -94,7 +94,6 @@ int hifn_freesession __P((u_int64_t));
int hifn_process __P((struct cryptop *));
void hifn_callback __P((struct hifn_softc *, struct hifn_command *, u_int8_t *));
int hifn_crypto __P((struct hifn_softc *, hifn_command_t *));
-void hifn_show_packed __P((char *s, long *pp, int *pl, int npa, int l));
struct hifn_stats {
u_int64_t hst_ibytes;
@@ -1301,8 +1300,15 @@ hifn_callback(sc, cmd, macbuf)
}
if ((m = cmd->dst_m) != NULL) {
+ int totlen = cmd->src_l, len;
+
while (m) {
- m->m_len = dma->dstr[dma->dstk].l & HIFN_D_LENGTH;
+ len = dma->dstr[dma->dstk].l & HIFN_D_LENGTH;
+ if (len > totlen)
+ len = totlen;
+ else
+ totlen -= len;
+ m->m_len = len;
hifnstats.hst_obytes += m->m_len;
m = m->m_next;
if (++dma->dstk == HIFN_D_DST_RSIZE)