From owner-freebsd-net@FreeBSD.ORG Tue Apr 7 22:24:23 2015 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2436A4D; Tue, 7 Apr 2015 22:24:23 +0000 (UTC) Received: from mail-in6.apple.com (mail-out6.apple.com [17.151.62.28]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81633620; Tue, 7 Apr 2015 22:24:23 +0000 (UTC) Received: from relay7.apple.com (relay7.apple.com [17.128.113.101]) by mail-in6.apple.com (Apple Secure Mail Relay) with SMTP id 76.31.09025.11954255; Tue, 7 Apr 2015 15:24:17 -0700 (PDT) X-AuditID: 11973e15-f79fd6d000002341-2d-55245911f842 Received: from [17.149.235.34] (Unknown_Domain [17.149.235.34]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by relay7.apple.com (Apple SCV relay) with SMTP id 90.7B.24525.1E854255; Tue, 7 Apr 2015 15:23:29 -0700 (PDT) Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Subject: Re: [BUG?] dhclient sends packets with source IP address that has been deleted From: Charles Swiger In-Reply-To: <5524472C.1050905@rawbw.com> Date: Tue, 7 Apr 2015 15:24:17 -0700 Message-Id: References: <55234B74.5020506@rawbw.com> <20150407145354.GA9746@spindle.one-eyed-alien.net> <5524472C.1050905@rawbw.com> To: Yuri X-Mailer: Apple Mail (2.2070.6) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJLMWRmVeSWpSXmKPExsUi2FCYqisYqRJqcPqNksXr/5UWi9Y2slp8 2H6AyYHZY8an+SweC9dcYA1giuKySUnNySxLLdK3S+DKWPX2AHPBN+WK4zffszQwLpbrYuTk kBAwkZhx5TgThC0mceHeer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pzsCiJ82oFA6UE0hNL UrNTUwtSi2CyTBycUg2Ma8Qbqr7GuyRPf6S3rPahQPD75jBdibWKyzL3Xko377kQcE5aj5Xl ktCUoI/XZR7/uPPvV2drW8Zn9mMXVW9s0dILvXjyRl6wHMO+fta/E6VLqhIS30+ZptwZqtGz bfLTRslT/iV/5V29hRwd06YkBRernHedLdMxdfn9jLDHJpz/7mvcKbupxFKckWioxVxUnAgA i4Zd+U8CAAA= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: Brooks Davis , 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: Tue, 07 Apr 2015 22:24:23 -0000 On Apr 7, 2015, at 2:07 PM, Yuri wrote: > On 04/07/2015 07:53, Brooks Davis wrote: >> I suppose that since dhclient has been killed and restarted it can't >> know it's on the same network, but in practice you want to try to get >> the same lease again and fall back if it turns out you've moved or = your dhcp >> server is broken and lost state. I don't see how this would hurt = anything. >=20 > Let's say dhclient is restarted after a while (ex. after the reboot), = when some other host already has that same IP address. dhclient sends = the broadcast with it, and the response will be sent to another host, = which currently has that address, and that other host will discard this = response. dhclient keeps trying for many seconds, doesn't get any = response. Then it falls back to sending from 0.0.0.0->255.255.255.255 = (as it should have done in the first place), and immediately gets the = valid response. The problem delays DHCP handshake, this is how this can = hurt. In point of fact, the IP used for the source address doesn't matter too = much for DHREQUESTs because they are subnet local (by definition), and = the replies will reach the original sender because they are addressed to = the layer-2 MAC address of that host. DHCP operates as much on layer-2 = as layer-3 and dhclient, ISC dhcpd, and other DHCP software should = handle such cases. There is a specific protocol coming from Zeroconf defined here: http://www.ietf.org/rfc/rfc5227.txt = ...which talks about how to handle potential IP conflicts via ARP = probing. Regards, --=20 -Chuck