DHCPClient: Check return code of SetAddress().

This should break DHCP for everyone it currently works for (according
to our analysis). If it doesn't, we have yet another (set of) bug(s).
This commit is contained in:
Augustin Cavalier 2015-07-29 15:06:04 -04:00
parent b3e2208e52
commit f9ab315e02

View File

@ -763,10 +763,17 @@ DHCPClient::_ParseOptions(dhcp_message& message, BMessage& address,
break;
}
case OPTION_SERVER_ADDRESS:
{
syslog(LOG_DEBUG, " server: %s\n",
_AddressToString(data).String());
fServer.SetAddress(*(in_addr_t*)data);
status_t status = fServer.SetAddress(*(in_addr_t*)data);
if (status != B_OK) {
syslog(LOG_ERR, " BNetworkAddress::SetAddress failed with %s!\n",
strerror(status));
fServer.Unset();
}
break;
}
case OPTION_ADDRESS_LEASE_TIME:
syslog(LOG_DEBUG, " lease time: %lu seconds\n",