Correctly set the data length when transmitting 802.3 frames (we need to

subtract the length of the SNAP header).
This commit is contained in:
Bill Paul 2000-01-12 00:57:27 +00:00
parent def6f6178c
commit 8647d85ac3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55831
2 changed files with 4 additions and 6 deletions

View File

@ -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,

View File

@ -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,