VirtualBox

Ignore:
Timestamp:
Feb 1, 2011 12:31:15 PM (14 years ago)
Author:
vboxsync
Message:

netadp: Re-create configured vboxnetX interfaces (#4213) on Darwin and FreeBSD

File:
1 edited

Legend:

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

    r35786 r35809  
    136136    pUuid->Gen.u8ClockSeqHiAndReserved = (pUuid->Gen.u8ClockSeqHiAndReserved & 0x3f) | 0x80;
    137137    pUuid->Gen.u16TimeHiAndVersion = (pUuid->Gen.u16TimeHiAndVersion & 0x0fff) | 0x4000;
    138     pUuid->Gen.u8ClockSeqLow = pThis->uUnit;
     138    pUuid->Gen.u8ClockSeqLow = pThis->nUnit;
    139139    vboxNetAdpComposeMACAddress(pThis, (PRTMAC)pUuid->Gen.au8Node);
    140140}
     
    193193
    194194
    195 int vboxNetAdpOsCreate(PVBOXNETADP pThis, PCRTMAC pMACAddress, const char *pcszName)
    196 {
    197     /* TODO: Use pcszName */
     195
     196int vboxNetAdpOsCreate(PVBOXNETADP pThis, PCRTMAC pMACAddress)
     197{
    198198    int rc;
    199199    struct ifnet_init_params Params;
     
    216216    memcpy(LLADDR(&mac), pMACAddress->au8, mac.sdl_alen);
    217217
    218     RTStrPrintf(pThis->szName, VBOXNETADP_MAX_NAME_LEN, "%s%d", VBOXNETADP_NAME, pThis->uUnit);
     218    RTStrPrintf(pThis->szName, VBOXNETADP_MAX_NAME_LEN, "%s%d", VBOXNETADP_NAME, pThis->nUnit);
    219219    vboxNetAdpDarwinComposeUUID(pThis, &uuid);
    220220    Params.uniqueid = uuid.au8;
    221221    Params.uniqueid_len = sizeof(uuid);
    222222    Params.name = VBOXNETADP_NAME;
    223     Params.unit = pThis->uUnit;
     223    Params.unit = pThis->nUnit;
    224224    Params.family = IFNET_FAMILY_ETHERNET;
    225225    Params.type = IFT_ETHER;
     
    294294    if (rc == VERR_TIMEOUT)
    295295        LogRel(("VBoxAdpDrv: Failed to detach interface %s%d\n.",
    296                 VBOXNETADP_NAME, pThis->uUnit));
     296                VBOXNETADP_NAME, pThis->nUnit));
    297297    err = ifnet_release(pThis->u.s.pIface);
    298298    if (err)
     
    348348        case IOCBASECMD(VBOXNETADP_CTL_ADD):
    349349        {
    350             if (   (IOC_DIRMASK & iCmd) != IOC_OUT
     350            if (   (IOC_DIRMASK & iCmd) != IOC_INOUT
    351351                || cbReq < sizeof(VBOXNETADPREQ))
    352352                return EINVAL;
    353353
    354354            PVBOXNETADP pNew;
    355             rc = vboxNetAdpCreate(&pNew, NULL);
     355            Log(("VBoxNetAdpDarwinIOCtl: szName=%s\n", pReq->szName));
     356            rc = vboxNetAdpCreate(&pNew,
     357                                  pReq->szName[0] && RTStrEnd(pReq->szName, RT_MIN(cbReq, sizeof(pReq->szName))) ?
     358                                  pReq->szName : NULL);
    356359            if (RT_FAILURE(rc))
    357360                return EINVAL;
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