FindFirstAddress returns errno when there is no address matching your search

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40411 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexander von Gluck IV 2011-02-09 21:01:17 +00:00
parent 245df7abd3
commit 9b533c387c
1 changed files with 4 additions and 2 deletions

View File

@ -67,12 +67,14 @@ NetworkSettings::ReadConfiguration()
BNetworkInterfaceAddress netIntAddr4;
BNetworkInterfaceAddress netIntAddr6;
if (fNetworkInterface.GetAddressAt(zeroAddrV4, netIntAddr4) == B_OK) {
if (zeroAddrV4 != errno) {
fNetworkInterface.GetAddressAt(zeroAddrV4, netIntAddr4);
fIPv4Addr = netIntAddr4.Address();
fIPv4Mask = netIntAddr4.Mask();
}
if (fNetworkInterface.GetAddressAt(zeroAddrV6, netIntAddr6) == B_OK) {
if (zeroAddrV6 != errno) {
fNetworkInterface.GetAddressAt(zeroAddrV6, netIntAddr6);
fIPv6Addr = netIntAddr6.Address();
fIPv6Mask = netIntAddr6.Mask();
}