VirtualBox

Ignore:
Timestamp:
Jan 31, 2014 10:54:41 AM (11 years ago)
Author:
vboxsync
Message:

Mac OS X host: Networking: prevent stuck-in-dock problem if cable is not attached to a network card device.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp

    r48952 r50298  
    983983
    984984
     985/**
     986 * Attempt to detect if a cable is attached to a network card.
     987 * There is no direct way to detect this at any time. We assume
     988 * if interface's baud rate is not zero then cable is attached.
     989 */
     990static int vboxNetFltCableAttached(ifnet_t pIfNet)
     991{
     992    return (ifnet_baudrate(pIfNet) != 0);
     993}
     994
     995
    985996int  vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *pvIfData, PINTNETSG pSG, uint32_t fDst)
    986997{
     
    9911002    if (pIfNet)
    9921003    {
     1004        /*
     1005         * Do not send any data to a network stack if cable is not attached
     1006         * to a network card device in order to prevent stuck-in-dock problem. */
     1007        if (!vboxNetFltCableAttached(pIfNet))
     1008        {
     1009            vboxNetFltDarwinReleaseIfNet(pThis, pIfNet);
     1010            return rc;
     1011        }
     1012
    9931013        /*
    9941014         * Create a mbuf for the gather list and push it onto the wire.
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