VirtualBox

Changeset 67974 in vbox


Ignore:
Timestamp:
Jul 14, 2017 1:50:51 PM (7 years ago)
Author:
vboxsync
Message:

bugref:8881: DevE1000: fixes

File:
1 edited

Legend:

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

    r67971 r67974  
    37253725                 pThis->fVTag ? "VLAN " : "",
    37263726                 pThis->fGSO ? "GSO " : ""));
    3727         pThis->cbTxAlloc = 0;
    37283727    }
    37293728    else
     
    37413740        pSg->aSegs[0].cbSeg = sizeof(pThis->aTxPacketFallback);
    37423741    }
     3742    pThis->cbTxAlloc = 0;
    37433743
    37443744    pThis->CTX_SUFF(pTxSg) = pSg;
     
    43664366
    43674367    uint16_t u16MaxPktLen = pThis->contextTSE.dw3.u8HDRLEN + pThis->contextTSE.dw3.u16MSS;
    4368     Assert(u16MaxPktLen != 0);
    4369     Assert(u16MaxPktLen < E1K_MAX_TX_PKT_SIZE);
     4368    if (RT_UNLIKELY(u16MaxPktLen <= pThis->contextTSE.dw3.u8HDRLEN))
     4369    {
     4370        E1kLog(("%s Transmit packet is too small: %u <= %u(min)\n", pThis->szPrf, u16MaxPktLen, pThis->contextTSE.dw3.u8HDRLEN));
     4371        return VINF_SUCCESS; // @todo consider VERR_BUFFER_UNDERFLOW;
     4372    }
     4373    if (RT_UNLIKELY(u16MaxPktLen > E1K_MAX_TX_PKT_SIZE || u16MaxPktLen > pThis->CTX_SUFF(pTxSg)->cbAvailable))
     4374    {
     4375        E1kLog(("%s Transmit packet is too large: %u > %u(max)\n", pThis->szPrf, u16MaxPktLen, E1K_MAX_TX_PKT_SIZE));
     4376        return VINF_SUCCESS; // @todo consider VERR_BUFFER_OVERFLOW;
     4377    }
    43704378
    43714379    /*
    43724380     * Carve out segments.
    43734381     */
    4374     int rc;
     4382    int rc = VINF_SUCCESS;
    43754383    do
    43764384    {
     
    44064414    }
    44074415
    4408     return false;
     4416    return VINF_SUCCESS; // @todo consider rc;
    44094417}
    44104418#endif /* E1K_WITH_TXD_CACHE */
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