* Also create a new address for B_SOCKET_SET_ALIAS if the index is -1 - this
now has an almost equivalent logic to the old setters like SIOCSIFADDR. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38054 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
910ffb32fe
commit
a271028e37
|
@ -724,6 +724,19 @@ Interface::Control(net_domain* domain, int32 option, ifreq& request,
|
|||
// Find first address for family
|
||||
address = FirstForFamily(domain->family);
|
||||
}
|
||||
if (address == NULL) {
|
||||
// Create new on the fly
|
||||
address = new(std::nothrow) InterfaceAddress(this, domain);
|
||||
if (address == NULL)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
status_t status = AddAddress(address);
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
// Note, even if setting the address failed, the empty
|
||||
// address added here will still be added to the interface.
|
||||
}
|
||||
} else
|
||||
address = AddressAt(aliasRequest.ifra_index);
|
||||
|
||||
|
|
Loading…
Reference in New Issue