VirtualBox

Changeset 35895 in vbox


Ignore:
Timestamp:
Feb 8, 2011 12:47:13 PM (14 years ago)
Author:
vboxsync
Message:

Main/HostOnly: preserve vboxnetX with default address and mask (#4213)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/HostImpl.cpp

    r35814 r35895  
    11011101    int r = NetIfCreateHostOnlyNetworkInterface(m->pParent, aHostNetworkInterface, aProgress);
    11021102    if (RT_SUCCESS(r))
    1103         return S_OK;
     1103    {
     1104        Bstr name;
     1105
     1106        HRESULT hrc = (*aHostNetworkInterface)->COMGETTER(Name)(name.asOutParam());
     1107        ComAssertComRCRet(hrc, hrc);
     1108        /*
     1109         * We need to write the default IP address and mask to extra data now,
     1110         * so the interface gets re-created after vboxnetadp.ko reload.
     1111         * Note that we avoid calling EnableStaticIpConfig since it would
     1112         * change the address on host's interface as well and we want to
     1113         * postpone the change until VM actually starts.
     1114         */
     1115        hrc = m->pParent->SetExtraData(BstrFmt("HostOnly/%ls/IPAddress", name.raw()).raw(),
     1116                                    getDefaultIPv4Address(name).raw());
     1117        ComAssertComRCRet(hrc, hrc);
     1118        hrc = m->pParent->SetExtraData(BstrFmt("HostOnly/%ls/IPNetMask", name.raw()).raw(),
     1119                                    Bstr(VBOXNET_IPV4MASK_DEFAULT).raw());
     1120
     1121        return hrc;
     1122    }
    11041123
    11051124    return r == VERR_NOT_IMPLEMENTED ? E_NOTIMPL : E_FAIL;
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