Make dhcp-lease-time option supersedable as well.

Note: It is not recommended to set this value to above the value that
the server provided, unless that value is bogus.
This commit is contained in:
Nick Hibma 2017-03-30 18:20:04 +00:00
parent 9bfb310cf3
commit 1fb4382cb2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=316285

View File

@ -756,7 +756,11 @@ dhcpack(struct packet *packet)
cancel_timeout(send_request, ip);
/* Figure out the lease time. */
if (ip->client->new->options[DHO_DHCP_LEASE_TIME].data)
if (ip->client->config->default_actions[DHO_DHCP_LEASE_TIME] ==
ACTION_SUPERSEDE)
ip->client->new->expiry = getULong(
ip->client->config->defaults[DHO_DHCP_LEASE_TIME].data);
else if (ip->client->new->options[DHO_DHCP_LEASE_TIME].data)
ip->client->new->expiry = getULong(
ip->client->new->options[DHO_DHCP_LEASE_TIME].data);
else