Changeset 17989 in vbox
- Timestamp:
- Mar 16, 2009 11:24:48 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/HostNetworkInterfaceImpl.cpp
r17981 r17989 414 414 CheckComRCReturnRC (autoCaller.rc()); 415 415 416 if (Bstr(aIPAddress).isEmpty()) 417 if (m.IPAddress) 418 return NetIfEnableStaticIpConfig(mVBox, this, m.IPAddress, 0, 0); 419 else 420 return S_OK; 421 416 422 ULONG ip, mask; 417 423 ip = inet_addr(Utf8Str(aIPAddress).raw()); 418 424 if(ip != INADDR_NONE) 419 425 { 420 mask = inet_addr(Utf8Str(aNetMask).raw()); 426 if (Bstr(aNetMask).isEmpty()) 427 mask = 0xFFFFFF; 428 else 429 mask = inet_addr(Utf8Str(aNetMask).raw()); 421 430 if(mask != INADDR_NONE) 422 431 { 423 int rc = NetIfEnableStaticIpConfig(mVBox, this, m.IPAddress, ip, mask); 432 int rc = S_OK; 433 if (m.IPAddress != ip || m.networkMask != mask) 434 rc = NetIfEnableStaticIpConfig(mVBox, this, m.IPAddress, ip, mask); 424 435 if (RT_SUCCESS(rc)) 425 436 { … … 451 462 CheckComRCReturnRC (autoCaller.rc()); 452 463 453 int rc = NetIfEnableStaticIpConfigV6(mVBox, this, m.IPV6Address, aIPV6Address, aIPV6MaskPrefixLength); 464 if (aIPV6MaskPrefixLength == 0) 465 aIPV6MaskPrefixLength = 64; 466 int rc = S_OK; 467 if (m.IPV6Address != aIPV6Address || m.IPV6NetworkMaskPrefixLength != aIPV6MaskPrefixLength) 468 rc = NetIfEnableStaticIpConfigV6(mVBox, this, m.IPV6Address, aIPV6Address, aIPV6MaskPrefixLength); 454 469 if (RT_FAILURE(rc)) 455 470 {
Note:
See TracChangeset
for help on using the changeset viewer.