diff options
Diffstat (limited to 'src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp')
-rw-r--r-- | src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp b/src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp index 62ec75d69..ac089e8e7 100644 --- a/src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp +++ b/src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp @@ -1,4 +1,4 @@ -/* $Id: HostNetworkInterfaceImpl.cpp 37353 2011-06-07 14:35:02Z vboxsync $ */ +/* $Id: HostNetworkInterfaceImpl.cpp 38406 2011-08-10 15:40:47Z vboxsync $ */ /** @file * @@ -563,29 +563,11 @@ HRESULT HostNetworkInterface::setVirtualBox(VirtualBox *pVBox) HRESULT hrc = mVBox->GetExtraData(BstrFmt("HostOnly/%ls/IPAddress", mInterfaceName.raw()).raw(), tmpAddr.asOutParam()); hrc = mVBox->GetExtraData(BstrFmt("HostOnly/%ls/IPNetMask", mInterfaceName.raw()).raw(), tmpMask.asOutParam()); if (tmpAddr.isEmpty()) - { tmpAddr = getDefaultIPv4Address(mInterfaceName); - /* - * We need to write the default IP address and mask to extra data now, - * so the interface gets re-created after vboxnetadp.ko reload. - * Note that we avoid calling EnableStaticIpConfig since it would - * change the address on host's interface as well and we want to - * postpone the change until VM actually starts. - */ - hrc = mVBox->SetExtraData(BstrFmt("HostOnly/%ls/IPAddress", - mInterfaceName.raw()).raw(), - tmpAddr.raw()); - ComAssertComRCRet(hrc, hrc); - } if (tmpMask.isEmpty()) - { tmpMask = Bstr(VBOXNET_IPV4MASK_DEFAULT); - hrc = mVBox->SetExtraData(BstrFmt("HostOnly/%ls/IPNetMask", - mInterfaceName.raw()).raw(), - Bstr(VBOXNET_IPV4MASK_DEFAULT).raw()); - ComAssertComRCRet(hrc, hrc); - } + m.IPAddress = inet_addr(Utf8Str(tmpAddr).c_str()); m.networkMask = inet_addr(Utf8Str(tmpMask).c_str()); } |