VirtualBox

Changeset 81218 in vbox


Ignore:
Timestamp:
Oct 10, 2019 4:10:59 PM (5 years ago)
Author:
vboxsync
Message:

Dev/E1000: Checksum and segmentation offloading validity checks.

File:
1 edited

Legend:

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

    r81031 r81218  
    24332433    }
    24342434    /* Compute checksum of complete packet */
    2435     uint16_t checksum = e1kCSum16(rxPacket + GET_BITS(RXCSUM, PCSS), cb);
     2435    size_t cbCSumStart = RT_MIN(GET_BITS(RXCSUM, PCSS), cb);
     2436    uint16_t checksum = e1kCSum16(rxPacket + cbCSumStart, cb - cbCSumStart);
    24362437    e1kRxChecksumOffload(pThis, rxPacket, cb, &status);
    24372438
     
    42474248    E1kLog3(("%s e1kFallbackAddSegment: Length=%x, remaining payload=%x, header=%x, send=%RTbool\n",
    42484249             pThis->szPrf, u16Len, pThis->u32PayRemain, pThis->u16HdrRemain, fSend));
    4249     Assert(pThis->u32PayRemain + pThis->u16HdrRemain > 0);
     4250    AssertReturn(pThis->u32PayRemain + pThis->u16HdrRemain > 0, VINF_SUCCESS);
    42504251
    42514252    if (pThis->u16TxPktLen + u16Len <= sizeof(pThis->aTxPacketFallback))
     
    42864287    }
    42874288
    4288     pThis->u32PayRemain -= u16Len;
     4289    if (u16Len > pThis->u32PayRemain)
     4290        pThis->u32PayRemain = 0;
     4291    else
     4292        pThis->u32PayRemain -= u16Len;
    42894293
    42904294    if (fSend)
     
    44544458
    44554459    uint16_t u16MaxPktLen = pThis->contextTSE.dw3.u8HDRLEN + pThis->contextTSE.dw3.u16MSS;
     4460    /* We cannot produce empty packets, ignore all TX descriptors (see @bugref{9571}) */
     4461    if (u16MaxPktLen == 0)
     4462        return VINF_SUCCESS;
    44564463
    44574464    /*
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