VirtualBox

Changeset 90175 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Jul 14, 2021 8:48:27 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145691
Message:

Network: (bugref:10024) Fixed UDP header handling when carving segments destructively.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmnetinline.h

    r86535 r90175  
    414414     * Figure out where the payload is and where the header starts before we
    415415     * do the protocol specific carving.
     416     *
     417     * UDP GSO uses IPv4 fragmentation, meaning that UDP header is present in
     418     * the first fragment only. When computing the total frame size of the
     419     * first fragment we need to use PDMNETWORKGSO::cbHdrsTotal instead of
     420     * PDMNETWORKGSO::cbHdrsSeg. In case of TCP GSO both cbHdrsTotal and
     421     * cbHdrsSeg have the same value, so it will work as well.
    416422     */
    417423    uint8_t * const pbSegHdrs    = pbFrame + pGso->cbMaxSeg * iSeg;
    418424    uint8_t * const pbSegPayload = pbSegHdrs + pGso->cbHdrsSeg;
    419425    uint32_t const  cbSegPayload = pdmNetSegPayloadLen(pGso, iSeg, cSegs, (uint32_t)cbFrame);
    420     uint32_t const  cbSegFrame   = cbSegPayload + pGso->cbHdrsSeg;
     426    uint32_t const  cbSegFrame   = cbSegPayload + (iSeg ? pGso->cbHdrsSeg : pGso->cbHdrsTotal);
    421427
    422428    /*
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