summaryrefslogtreecommitdiff
path: root/sys/arch/mvme68k/stand/netboot
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2003-01-28 01:37:53 +0000
committerJason Wright <jason@cvs.openbsd.org>2003-01-28 01:37:53 +0000
commitbaefabe63a283d94a74bea9dad3dbf113ada3909 (patch)
tree91372f0752480b246f86c7c2debecf5f72ecdefe /sys/arch/mvme68k/stand/netboot
parent3dcab5460de0a9bdd7d160d7a3ee928abc93cb48 (diff)
pad < minimal length packets with 0's; based on netbsd; tested by miod
Diffstat (limited to 'sys/arch/mvme68k/stand/netboot')
-rw-r--r--sys/arch/mvme68k/stand/netboot/if_ie.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/arch/mvme68k/stand/netboot/if_ie.c b/sys/arch/mvme68k/stand/netboot/if_ie.c
index 48c45acb861..db50fb81382 100644
--- a/sys/arch/mvme68k/stand/netboot/if_ie.c
+++ b/sys/arch/mvme68k/stand/netboot/if_ie.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ie.c,v 1.9 2002/03/14 01:26:38 millert Exp $ */
+/* $OpenBSD: if_ie.c,v 1.10 2003/01/28 01:37:52 jason Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -39,6 +39,7 @@
#define ETHER_MIN_LEN 64
#define ETHER_MAX_LEN 1518
+#define ETHER_CRC_LEN 4
#define NTXBUF 1
#define NRXBUF 16
@@ -381,7 +382,11 @@ ie_put(desc, pkt, len)
/* copy data */
bcopy(p, (void *)&iem->im_txbuf[xx], len);
- len = MAX(len, ETHER_MIN_LEN);
+ if (len < ETHER_MIN_LEN - ETHER_CRC_LEN) {
+ bzero((char *)&iem->im_txbuf[xx] + len,
+ ETHER_MIN_LEN - ETHER_CRC_LEN - len);
+ len = ETHER_MIN_LEN - ETHER_CRC_LEN;
+ }
/* build transmit descriptor */
iem->im_xd[xx].ie_xmit_flags = len | IE_XMIT_LAST;