VirtualBox

Changeset 57913 in vbox


Ignore:
Timestamp:
Sep 27, 2015 2:43:54 AM (9 years ago)
Author:
vboxsync
Message:

VBoxNetAdp/darwin: Common pattern in the kernel code is

ifnet_set_flags(interface, ...);
ifnet_ioctl(interface, 0, SIOCSIFFLAGS, NULL);

Implement ifnet_ioctl_func and stub out this case so that
VBoxNetFlt-darwin.cpp doesn't complain that it failed to put vboxnet
into promiscuous mode.

File:
1 edited

Legend:

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

    r57912 r57913  
    215215}
    216216
     217
     218static errno_t vboxNetAdpDarwinIfIOCtl(ifnet_t pIface, unsigned long uCmd, void *pvData)
     219{
     220    errno_t error = 0;
     221
     222    switch (uCmd)
     223    {
     224        /*
     225         * Common pattern in the kernel code is:
     226         *   ifnet_set_flags(interface, ...);
     227         *   ifnet_ioctl(interface, 0, SIOCSIFFLAGS, NULL);
     228         *
     229         * Stub this case out so that VBoxNetFlt-darwin.cpp doesn't
     230         * complain that it failed to put vboxnet into promiscuous
     231         * mode.
     232         */
     233        case SIOCSIFFLAGS:
     234            if (pvData != NULL)
     235            {
     236                error = ENOTSUP;
     237            }
     238            break;
     239
     240        default:
     241            error = ether_ioctl(pIface, uCmd, pvData);
     242            break;
     243    }
     244
     245    return error;
     246}
     247
     248
    217249int vboxNetAdpOsCreate(PVBOXNETADP pThis, PCRTMAC pMACAddress)
    218250{
     
    252284    Params.framer = ether_frameout;
    253285    Params.softc = pThis;
    254     Params.ioctl = (ifnet_ioctl_func)ether_ioctl;
     286    Params.ioctl = vboxNetAdpDarwinIfIOCtl;
    255287    Params.set_bpf_tap = NULL;
    256288    Params.detach = vboxNetAdpDarwinDetach;
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