From owner-freebsd-net@FreeBSD.ORG Tue Jul 31 14:56:52 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 553151065672 for ; Tue, 31 Jul 2012 14:56:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 28E158FC14 for ; Tue, 31 Jul 2012 14:56:52 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 82B35B964; Tue, 31 Jul 2012 10:56:51 -0400 (EDT) From: John Baldwin To: freebsd-net@freebsd.org Date: Tue, 31 Jul 2012 09:43:00 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <4FFF3683.7020107@rawbw.com> <500066F4.2030102@rawbw.com> <20120714075125.GA566@DataIX.net> In-Reply-To: <20120714075125.GA566@DataIX.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201207310943.00547.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 31 Jul 2012 10:56:51 -0400 (EDT) Cc: Peter Jeremy , Yuri Subject: Re: System doesn't detect unplugged network cable and doesn't set interface up properly with DHCP X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 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, 31 Jul 2012 14:56:52 -0000 On Saturday, July 14, 2012 3:51:25 am Jason Hellenthal wrote: > > On Fri, Jul 13, 2012 at 11:20:36AM -0700, Yuri wrote: > > On 07/13/2012 02:48, Peter Jeremy wrote: > > > This is a bug in dhclient - see PR bin/166656, which includes a fix. > > > > I think this PR addresses part of the problem: dhclient doesn't exit when the link goes down. > > To the best of my knowledge this is the correct way to handle this. Why > not reuse whats already been set if the link was to be brought back up > ? ofcourse it should obviously change to the correct IP if another was > negotiated but that is rarely the case. The new dhclient will try to use an existing lease when it negotiates, so I think that it should DTRT. > > But even if it exits, it leaves the IP address that it has set, which is wrong. This IP address survives through the next DHCP setup process and ends up being the second IP address. > > Should be very easy to on exit remove any IP address that was set during dhclient process lifetime. > > I couldnt agree more. Interface tear down is definately needed here. Hmmm, this does seem true. Do you either of you have any patches for this, or Peter, can you extend your patch to do this? -- John Baldwin