From owner-svn-src-all@freebsd.org Thu Mar 30 18:20:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B032D26E9D; Thu, 30 Mar 2017 18:20:05 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AB40934; Thu, 30 Mar 2017 18:20:05 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UIK4mX001578; Thu, 30 Mar 2017 18:20:04 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UIK416001577; Thu, 30 Mar 2017 18:20:04 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201703301820.v2UIK416001577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Thu, 30 Mar 2017 18:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316285 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 18:20:05 -0000 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