There is no point trying to request back from DHCP a link-local

auto-configured address...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41538 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Houdoin 2011-05-16 16:00:18 +00:00
parent d7a82feb5c
commit b6ba1daaac
1 changed files with 12 additions and 5 deletions

View File

@ -446,6 +446,13 @@ DHCPClient::DHCPClient(BMessenger target, const char* device)
BNetworkAddress address = interfaceAddress.Address();
const sockaddr_in& addr = (sockaddr_in&)address.SockAddr();
fAssignedAddress = addr.sin_addr.s_addr;
if ((ntohl(fAssignedAddress) & IN_CLASSB_NET) == 0xa9fe0000) {
// previous auto-configured address is a link-local one:
// there is no point asking a DHCP server to renew such
// server-less assigned address...
fAssignedAddress = 0;
}
}
}
@ -561,8 +568,8 @@ DHCPClient::_Negotiate(dhcp_state state)
_SendMessage(socket, state == INIT ? discover : request,
state != RENEWING ? broadcast : fServer);
continue;
} else if (bytesReceived < 0)
break;