VirtualBox

Changeset 28075 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Apr 7, 2010 11:42:21 PM (15 years ago)
Author:
vboxsync
Message:

intnetinline.h: INTNETRingCommitFrameEx must account for the GSO header.

File:
1 edited

Legend:

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

    r28068 r28075  
    462462
    463463/**
    464  * Reads an entire SG into a fittingly size buffer.
    465  *
    466  * @param   pSG         The SG list to read.
    467  * @param   pvBuf       The buffer to read into (at least pSG->cbTotal in size).
    468  */
    469 DECLINLINE(void) intnetR0SgRead(PCINTNETSG pSG, void *pvBuf)
    470 {
    471     if (pSG->cSegsUsed == 1)
    472     {
    473         Assert(pSG->cbTotal == pSG->aSegs[0].cb);
    474         memcpy(pvBuf, pSG->aSegs[0].pv, pSG->cbTotal);
    475     }
    476     else
    477     {
    478         uint8_t       *pbDst = (uint8_t *)pvBuf;
    479         unsigned const cSegs = pSG->cSegsUsed; Assert(cSegs == pSG->cSegsUsed);
    480         for (unsigned iSeg = 0; iSeg < cSegs; iSeg++)
    481         {
    482             uint32_t cbSeg = pSG->aSegs[iSeg].cb;
    483             Assert(cbSeg <= pSG->cbTotal && (uintptr_t)(pbDst - (uint8_t *)pvBuf) + cbSeg <= pSG->cbTotal);
    484             memcpy(pbDst, pSG->aSegs[iSeg].pv, cbSeg);
    485             pbDst += cbSeg;
    486         }
    487     }
    488 }
    489 
    490 
    491 
    492 
    493 
    494 
    495 
    496 /**
    497464 * Retain an interface.
    498465 *
     
    15261493    if (RT_SUCCESS(rc))
    15271494    {
    1528         intnetR0SgRead(pSG, pvDst);
     1495        INTNETSgRead(pSG, pvDst);
    15291496        if (pNewDstMac)
    15301497            ((PRTNETETHERHDR)pvDst)->DstMac = *pNewDstMac;
     
    24372404                INTNETSgInitTempGso(&Sg, pvCurFrame, cbFrame, pGso);
    24382405                if (pNetwork->fFlags & INTNET_OPEN_FLAGS_SHARED_MAC_ON_WIRE)
    2439                     intnetR0IfSnoopAddr(pIf, (uint8_t *)pvCurFrame, pHdr->cbFrame, true /*fGso*/, (uint16_t *)&Sg.fFlags);
     2406                    intnetR0IfSnoopAddr(pIf, (uint8_t *)pvCurFrame, cbFrame, true /*fGso*/, (uint16_t *)&Sg.fFlags);
    24402407                intnetR0NetworkSend(pNetwork, pIf, 0, &Sg, !!pTrunkIf);
    24412408            }
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