VirtualBox

Ignore:
Timestamp:
Feb 16, 2010 12:44:10 PM (15 years ago)
Author:
vboxsync
Message:

Networking: Preparing to make the driver return a send buffer to the device emulation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/NetLib/VBoxNetUDP.cpp

    r18463 r26574  
    2929#include <iprt/rand.h>
    3030#include <VBox/log.h>
     31#include <VBox/intnetinline.h>
    3132
    3233
     
    4647 * @param   pcb             Where to return the size of the data on success.
    4748 */
    48 void *VBoxNetUDPMatch(PCINTNETBUF pBuf, unsigned uDstPort, PCRTMAC pDstMac, uint32_t fFlags, PVBOXNETUDPHDRS pHdrs, size_t *pcb)
     49void *VBoxNetUDPMatch(PINTNETBUF pBuf, unsigned uDstPort, PCRTMAC pDstMac, uint32_t fFlags, PVBOXNETUDPHDRS pHdrs, size_t *pcb)
    4950{
    5051    /*
     
    6263     * Valid IntNet Ethernet frame?
    6364     */
    64     PCINTNETHDR pHdr = (PINTNETHDR)((uintptr_t)pBuf + pBuf->Recv.offRead);
    65     if (pHdr->u16Type != INTNETHDR_TYPE_FRAME)
    66         return NULL;
    67 
    68     size_t      cbFrame = pHdr->cbFrame;
    69     const void *pvFrame = INTNETHdrGetFramePtr(pHdr, pBuf);
     65    PCINTNETHDR pHdr = INTNETRingGetNextFrameToRead(&pBuf->Recv);
     66    if (!pHdr || pHdr->u16Type != INTNETHDR_TYPE_FRAME)
     67        return NULL;
     68
     69    size_t          cbFrame = pHdr->cbFrame;
     70    const void     *pvFrame = INTNETHdrGetFramePtr(pHdr, pBuf);
    7071    PCRTNETETHERHDR pEthHdr = (PCRTNETETHERHDR)pvFrame;
    7172    if (pHdrs)
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