summaryrefslogtreecommitdiffstats
path: root/sys/dev/wi
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2000-01-12 00:57:27 +0000
committerwpaul <wpaul@FreeBSD.org>2000-01-12 00:57:27 +0000
commit38bef851a95338a158481dceccb050acc92e7120 (patch)
tree3977ec468b925d2ddb4f7633b2e87248157c5201 /sys/dev/wi
parentc861b7fc025aaff63f4d4014ce998d965bcdd27c (diff)
downloadFreeBSD-src-38bef851a95338a158481dceccb050acc92e7120.zip
FreeBSD-src-38bef851a95338a158481dceccb050acc92e7120.tar.gz
Correctly set the data length when transmitting 802.3 frames (we need to
subtract the length of the SNAP header).
Diffstat (limited to 'sys/dev/wi')
-rw-r--r--sys/dev/wi/if_wi.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 0d36b80..6f005f7 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -1174,9 +1174,7 @@ static void wi_start(ifp)
* Use RFC1042 encoding for IP and ARP datagrams,
* 802.3 for anything else.
*/
- if (ntohs(eh->ether_type) == ETHERTYPE_IP ||
- ntohs(eh->ether_type) == ETHERTYPE_ARP ||
- ntohs(eh->ether_type) == ETHERTYPE_REVARP) {
+ if (ntohs(eh->ether_type) > 1518) {
bcopy((char *)&eh->ether_dhost,
(char *)&tx_frame.wi_addr1, ETHER_ADDR_LEN);
bcopy((char *)&eh->ether_shost,
@@ -1204,6 +1202,7 @@ static void wi_start(ifp)
} else {
tx_frame.wi_dat_len = m0->m_pkthdr.len;
+ eh->ether_type = htons(m0->m_pkthdr.len - WI_SNAPHDR_LEN);
m_copydata(m0, 0, m0->m_pkthdr.len, (caddr_t)&sc->wi_txbuf);
wi_write_data(sc, id, 0, (caddr_t)&tx_frame,
OpenPOWER on IntegriCloud