VirtualBox

Changeset 40799 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Apr 6, 2012 4:52:54 PM (13 years ago)
Author:
vboxsync
Message:

e1000: Handle packets with unstripped Ethernet CRC (#6152)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevE1000.cpp

    r40794 r40799  
    20272027    Assert(cb <= E1K_MAX_RX_PKT_SIZE);
    20282028    Assert(cb > 16);
     2029    size_t cbMax = ((RCTL & RCTL_LPE) ? E1K_MAX_RX_PKT_SIZE - 4 : 1518) - (status.fVP ? 0 : 4);
     2030    E1kLog3(("%s Max RX packet size is %u\n", INSTANCE(pState), cbMax));
    20292031    if (status.fVP)
    20302032    {
     
    20512053        cb = 60;
    20522054    }
    2053     if (!(RCTL & RCTL_SECRC))
     2055    if (!(RCTL & RCTL_SECRC) && cb <= cbMax)
    20542056    {
    20552057        STAM_PROFILE_ADV_START(&pState->StatReceiveCRC, a);
     
    20632065        cb += sizeof(uint32_t);
    20642066        STAM_PROFILE_ADV_STOP(&pState->StatReceiveCRC, a);
     2067        E1kLog3(("%s Added FCS (cb=%u)\n", INSTANCE(pState), cb));
    20652068    }
    20662069    /* Compute checksum of complete packet */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette