Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Mar 2017 18:20:04 +0000 (UTC)
From:      Nick Hibma <n_hibma@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r316285 - head/sbin/dhclient
Message-ID:  <201703301820.v2UIK416001577@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: n_hibma
Date: Thu Mar 30 18:20:04 2017
New Revision: 316285
URL: https://svnweb.freebsd.org/changeset/base/316285

Log:
  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.

Modified:
  head/sbin/dhclient/dhclient.c

Modified: head/sbin/dhclient/dhclient.c
==============================================================================
--- head/sbin/dhclient/dhclient.c	Thu Mar 30 17:37:12 2017	(r316284)
+++ head/sbin/dhclient/dhclient.c	Thu Mar 30 18:20:04 2017	(r316285)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703301820.v2UIK416001577>