net_server: fixed configuring disabled interfaces.

* BNetworkSettings now set unspecified addresses to their empty family
  specific addresses, instead of using AF_UNSPEC.
* This allows the net_server to set those addresses on the address
  specific stack interface.
This commit is contained in:
Axel Dörfler
2015-03-27 13:25:30 +01:00
parent 4621cda5bf
commit 0a6b562313
2 changed files with 6 additions and 2 deletions
@@ -196,8 +196,11 @@ get_address_family(const char* argument)
static bool
parse_address(int32& family, const char* argument, BNetworkAddress& address)
{
if (argument == NULL)
if (argument == NULL) {
if (family != AF_UNSPEC)
address.SetToWildcard(family);
return false;
}
status_t status = address.SetTo(family, argument, (uint16)0,
B_NO_ADDRESS_RESOLUTION);
+2 -1
View File
@@ -504,7 +504,8 @@ NetServer::_ConfigureInterface(BMessage& message)
if (!addressSettings.Address().IsEmpty()
|| !addressSettings.Mask().IsEmpty()
|| !addressSettings.Broadcast().IsEmpty()
|| !addressSettings.Peer().IsEmpty()) {
|| !addressSettings.Peer().IsEmpty()
|| !addressSettings.IsAutoConfigure()) {
BNetworkInterfaceAddress interfaceAddress;
interfaceAddress.SetAddress(addressSettings.Address());
interfaceAddress.SetMask(addressSettings.Mask());