From owner-freebsd-net@FreeBSD.ORG Thu Apr 9 08:56:18 2015 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8A37959; Thu, 9 Apr 2015 08:56:18 +0000 (UTC) Received: from relay.mailchannels.net (tkt-001-i372.relay.mailchannels.net [174.136.5.173]) by mx1.freebsd.org (Postfix) with ESMTP id A97C0B0; Thu, 9 Apr 2015 08:56:17 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|opaldns Received: from smtp3.ore.mailhop.org (ip-10-213-14-133.us-west-2.compute.internal [10.213.14.133]) by relay.mailchannels.net (Postfix) with ESMTPA id 5F09A6068D; Thu, 9 Apr 2015 08:40:54 +0000 (UTC) X-Sender-Id: duocircle|x-authuser|opaldns Received: from smtp3.ore.mailhop.org (smtp3.ore.mailhop.org [10.21.145.197]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:2500 (trex/5.4.8); Thu, 09 Apr 2015 08:40:54 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: duocircle|x-authuser|opaldns X-MailChannels-Auth-Id: duocircle X-MC-Loop-Signature: 1428568854488:600923317 X-MC-Ingress-Time: 1428568854488 Received: from pool-71-255-171-111.bstnma.east.verizon.net ([71.255.171.111] helo=homobox.opal.com) by smtp3.ore.mailhop.org with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1Yg816-0001fi-6H; Thu, 09 Apr 2015 08:40:52 +0000 Received: from shibato (ip51cd975c.adsl-surfen.hetnet.nl [81.205.151.92]) (authenticated bits=0) by homobox.opal.com (8.14.9/8.14.9) with ESMTP id t398eXLD050295 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Thu, 9 Apr 2015 04:40:35 -0400 (EDT) (envelope-from fbsd@opal.com) X-Mail-Handler: DuoCircle Outbound SMTP X-Originating-IP: 71.255.171.111 X-Report-Abuse-To: abuse@duocircle.com (see https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information for abuse reporting information) X-MHO-User: U2FsdGVkX1/JgSHPJ+8QqKedRrXWhpJd Date: Thu, 9 Apr 2015 10:40:17 +0200 From: "J.R. Oldroyd" To: Kevin Oberman Subject: Re: [BUG?] dhclient sends packets with source IP address that has been deleted Message-ID: <20150409104017.0cd5c909@shibato> In-Reply-To: References: <55234B74.5020506@rawbw.com> <20150407145354.GA9746@spindle.one-eyed-alien.net> <20150408100349.31a74103@shibato> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; amd64-portbld-freebsd10.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/Bn1Zy/M7J9lqQOzGibDudTT"; protocol="application/pgp-signature" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (homobox.opal.com [71.255.171.111]); Thu, 09 Apr 2015 04:40:36 -0400 (EDT) X-Spam-Status: No, score=4.0 required=5.0 tests=AWL,BAYES_50, FSL_HELO_NON_FQDN_1,RCVD_IN_PBL shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 X-Spam-Level: **** X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on homobox.opal.com X-AuthUser: opaldns Cc: Yuri , Brooks Davis , "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2015 08:56:18 -0000 --Sig_/Bn1Zy/M7J9lqQOzGibDudTT Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 8 Apr 2015 20:47:56 -0700 Kevin Oberman wrote: > The > idea is that a system should attempt to maintain the same address, if > possible. That is why the dhclient.leases files are there. Even if a syst= em > has its interface shut down or is rebooted, the file contains the last > assigned address. If it issues a request and the network is different, it > will not get the address. If it is on the same network, it will get it's > old address. >=20 > >From the RFC 4.3.2 DHCPREQUEST message: > 'requested IP address' option MUST be filled in with client's notion of i= ts > previously assigned address. >=20 The data from the leases file is used to fill in the requested IP address in the message body. The source address of the packet should be set to 0. The fix appears to be pretty trivial: Index: sbin/dhclient/dhclient.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sbin/dhclient/dhclient.c (revision 280783) +++ sbin/dhclient/dhclient.c (working copy) @@ -1460,7 +1460,8 @@ memcpy(&to.s_addr, ip->client->destination.iabuf, sizeof(to.s_addr)); =20 - if (ip->client->state !=3D S_REQUESTING) + if (ip->client->state !=3D S_REQUESTING && + ip->client->state !=3D S_REBOOTING) memcpy(&from, ip->client->active->address.iabuf, sizeof(from)); else --Sig_/Bn1Zy/M7J9lqQOzGibDudTT Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlUmOvsACgkQls33urr0k4neZQCfUg6I2WmBwYwq+zmg18c5syOV 1UYAnR5ZmrgJPjeVpKYutqfYOunX1pRG =2g1Q -----END PGP SIGNATURE----- --Sig_/Bn1Zy/M7J9lqQOzGibDudTT--