Skip to content

Commit

Permalink
dhclient: modify along the lines of other code found in the file
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Mar 25, 2017
1 parent 4af258d commit 702ff9b
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions sbin/dhclient/dhclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,20 +858,26 @@ void
state_bound(void *ipp)
{
struct interface_info *ip = ipp;
u_int8_t *dp = NULL;
int len;

ASSERT_STATE(state, S_BOUND);

/* T1 has expired. */
make_request(ip, ip->client->active);
ip->client->xid = ip->client->packet.xid;

if (ip->client->config->default_actions[DHO_DHCP_SERVER_IDENTIFIER] == ACTION_SUPERSEDE) {
memcpy(ip->client->destination.iabuf, ip->client->config->defaults[DHO_DHCP_SERVER_IDENTIFIER].data, 4);
ip->client->config->defaults[DHO_DHCP_SERVER_IDENTIFIER].len = 4;
} else if (ip->client->active->options[DHO_DHCP_SERVER_IDENTIFIER].len == 4) {
memcpy(ip->client->destination.iabuf, ip->client->active->
options[DHO_DHCP_SERVER_IDENTIFIER].data, 4);
ip->client->destination.len = 4;
if (ip->client->config->default_actions[DHO_DHCP_SERVER_IDENTIFIER] ==
ACTION_SUPERSEDE) {
dp = ip->client->config->defaults[DHO_DHCP_SERVER_IDENTIFIER].data;
len = ip->client->config->defaults[DHO_DHCP_SERVER_IDENTIFIER].len;
} else {
dp = ip->client->active->options[DHO_DHCP_SERVER_IDENTIFIER].data;
len = ip->client->active->options[DHO_DHCP_SERVER_IDENTIFIER].len;
}
if (len == 4) {
memcpy(ip->client->destination.iabuf, dp, len);
ip->client->destination.len = len;
} else
ip->client->destination = iaddr_broadcast;

Expand Down

0 comments on commit 702ff9b

Please sign in to comment.