summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2003-02-03 19:45:54 +0000
committerJason Wright <jason@cvs.openbsd.org>2003-02-03 19:45:54 +0000
commit62d083f2c5e53a0860b0464451f56cd8269121b9 (patch)
treedaaef6e35c9031bbb64097e37aa768bae03ec2e3 /sys
parente833d6e3ca9f6d12cc33c23560330c709b6d7e26 (diff)
pad tx buffer out to minimum framelength; based on NetBSD
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc/dev/if_ie.c9
-rw-r--r--sys/dev/isa/if_ie.c10
2 files changed, 15 insertions, 4 deletions
diff --git a/sys/arch/sparc/dev/if_ie.c b/sys/arch/sparc/dev/if_ie.c
index 1f3830ec657..2de0e608274 100644
--- a/sys/arch/sparc/dev/if_ie.c
+++ b/sys/arch/sparc/dev/if_ie.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ie.c,v 1.25 2002/11/10 21:23:06 miod Exp $ */
+/* $OpenBSD: if_ie.c,v 1.26 2003/02/03 19:45:53 jason Exp $ */
/* $NetBSD: if_ie.c,v 1.33 1997/07/29 17:55:38 fair Exp $ */
/*-
@@ -1444,7 +1444,12 @@ iestart(ifp)
printf("%s: tbuf overflow\n", sc->sc_dev.dv_xname);
m_freem(m0);
- len = max(len, ETHER_MIN_LEN);
+
+ if (len < ETHER_MIN_LEN - ETHER_CRC_LEN) {
+ bzero(buffer, ETHER_MIN_LEN - ETHER_CRC_LEN - len);
+ len = ETHER_MIN_LEN - ETHER_CRC_LEN;
+ buffer += ETHER_MIN_LEN - ETHER_CRC_LEN;
+ }
sc->xmit_buffs[sc->xchead]->ie_xmit_flags = SWAP(len);
sc->xmit_free--;
diff --git a/sys/dev/isa/if_ie.c b/sys/dev/isa/if_ie.c
index 387f168ca9b..9910ecd8c07 100644
--- a/sys/dev/isa/if_ie.c
+++ b/sys/dev/isa/if_ie.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ie.c,v 1.24 2002/03/14 01:26:56 millert Exp $ */
+/* $OpenBSD: if_ie.c,v 1.25 2003/02/03 19:45:53 jason Exp $ */
/* $NetBSD: if_ie.c,v 1.51 1996/05/12 23:52:48 mycroft Exp $ */
/*-
@@ -1510,9 +1510,15 @@ iestart(ifp)
bcopy(mtod(m, caddr_t), buffer, m->m_len);
buffer += m->m_len;
}
- len = max(m0->m_pkthdr.len, ETHER_MIN_LEN);
m_freem(m0);
+
+ if (len < ETHER_MIN_LEN - ETHER_CRC_LEN) {
+ bzero(buffer, ETHER_MIN_LEN - ETHER_CRC_LEN - len);
+ len = ETHER_MIN_LEN - ETHER_CRC_LEN;
+ buffer += ETHER_MIN_LEN - ETHER_CRC_LEN;
+ }
+
sc->xmit_buffs[sc->xchead]->ie_xmit_flags = len;
/* Start the first packet transmitting. */