Skip to content

Commit

Permalink
DHCPClient: Check return code of SetAddress().
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
waddlesplash committed Jul 29, 2015
1 parent b3e2208 commit f9ab315
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/servers/net/DHCPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f9ab315

Please sign in to comment.