Skip to content

Commit

Permalink
dhclient: support supersede statement for option 54
Browse files Browse the repository at this point in the history
Submitted by: Fabian Kurtz <fabian.kurtz@udo.edu>
  • Loading branch information
fichtner committed Aug 20, 2017
1 parent c1e3838 commit 14580e7
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions sbin/dhclient/dhclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,17 +862,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->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 14580e7

Please sign in to comment.