mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-30 08:43:23 +00:00
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:
parent
def6f6178c
commit
8647d85ac3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55831
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user