VirtualBox

Changeset 792 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 8, 2007 5:45:16 PM (18 years ago)
Author:
vboxsync
Message:

Check link states when sending data.

Location:
trunk/src/VBox/Devices/Network
Files:
2 edited

Legend:

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

    r754 r792  
    21842184        AssertReleaseRC(rc);
    21852185
    2186         rc = pcnetAsyncTransmit(pData);
     2186        if (pData->fLinkUp)
     2187            rc = pcnetAsyncTransmit(pData);
    21872188        PDMCritSectLeave(&pData->CritSect);
    21882189    }
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r786 r792  
    5757    /** Slirp critical section. */
    5858    RTCRITSECT              CritSect;
     59    /** Link state */
     60    PDMNETWORKLINKSTATE     enmLinkState;
    5961} DRVNAT, *PDRVNAT;
    6062
     
    99101    AssertReleaseRC(rc);
    100102
    101     slirp_input((uint8_t *)pvBuf, cb);
     103    Assert(pData->enmLinkState == PDMNETWORKLINKSTATE_UP);
     104    if (pData->enmLinkState == PDMNETWORKLINKSTATE_UP)
     105        slirp_input((uint8_t *)pvBuf, cb);
    102106    RTCritSectLeave(&pData->CritSect);
    103107    LogFlow(("drvNATSend: end\n"));
     
    138142    int rc = RTCritSectEnter(&pData->CritSect);
    139143    AssertReleaseRC(rc);
     144    pData->enmLinkState = enmLinkState;
     145
    140146    switch (enmLinkState)
    141147    {
     
    439445                    pDrvIns->pDrvHlp->pfnPDMPollerRegister(pDrvIns, drvNATPoller);
    440446                    g_pDrv = pData;
     447
     448                    pData->enmLinkState = PDMNETWORKLINKSTATE_UP;
    441449#if 0
    442450                    RTSemEventSignal(g_EventSem);
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