From owner-svn-src-stable-10@freebsd.org Fri Mar 9 14:39:29 2018 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 590D2F2DA1C; Fri, 9 Mar 2018 14:39:29 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07CCB79E37; Fri, 9 Mar 2018 14:39:29 +0000 (UTC) (envelope-from dab@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02B2820625; Fri, 9 Mar 2018 14:39:29 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w29EdSLe015419; Fri, 9 Mar 2018 14:39:28 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w29EdS3F015418; Fri, 9 Mar 2018 14:39:28 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201803091439.w29EdS3F015418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 9 Mar 2018 14:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r330693 - stable/10/sbin/dhclient X-SVN-Group: stable-10 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/10/sbin/dhclient X-SVN-Commit-Revision: 330693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2018 14:39:29 -0000 Author: dab Date: Fri Mar 9 14:39:28 2018 New Revision: 330693 URL: https://svnweb.freebsd.org/changeset/base/330693 Log: MFC r330085: dhclient violates RFC2131 when sending early DHCPREQUEST message to re-obtain old IP When dhclient first starts, if an old IP address exists in the dhclient.leases file, dhclient(8) sends early DHCPREQUEST message(s) in an attempt to re-obtain the old IP address again. These messages contain the old IP as a requested-IP-address option in the message body (correct) but also use the old IP address as the packet's source IP (incorrect). RFC2131 sec 4.1 states: DHCP messages broadcast by a client prior to that client obtaining its IP address must have the source address field in the IP header set to 0. The use of the old IP as the packet's source address is incorrect if (a) the computer is now on a different network or (b) it is on the same network, but the old IP has been reallocated to another host. Fix dhclient to use 0.0.0.0 as the source IP in this circumstance without removing any existing functionality. Any previously-used old IP is still requested in the body of an early DHCPREQUEST message. PR: 199378 Submitted by: J.R. Oldroyd Reported by: J.R. Oldroyd Sponsored by: Dell EMC Modified: stable/10/sbin/dhclient/dhclient.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/dhclient/dhclient.c ============================================================================== --- stable/10/sbin/dhclient/dhclient.c Fri Mar 9 14:38:46 2018 (r330692) +++ stable/10/sbin/dhclient/dhclient.c Fri Mar 9 14:39:28 2018 (r330693) @@ -1460,7 +1460,8 @@ cancel: memcpy(&to.s_addr, ip->client->destination.iabuf, sizeof(to.s_addr)); - if (ip->client->state != S_REQUESTING) + if (ip->client->state != S_REQUESTING && + ip->client->state != S_REBOOTING) memcpy(&from, ip->client->active->address.iabuf, sizeof(from)); else