From owner-freebsd-net@FreeBSD.ORG Mon Aug 20 12:31:42 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 B1FFA10656F3 for ; Mon, 20 Aug 2012 12:31:42 +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 079018FC22 for ; Mon, 20 Aug 2012 12:31:42 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 53D3CB945; Mon, 20 Aug 2012 08:31:41 -0400 (EDT) From: John Baldwin To: Peter Jeremy Date: Mon, 20 Aug 2012 08:28:48 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <4FFF3683.7020107@rawbw.com> <201208171148.17427.jhb@freebsd.org> <20120817225857.GA2377@server.rulingia.com> In-Reply-To: <20120817225857.GA2377@server.rulingia.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201208200828.48457.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 20 Aug 2012 08:31:41 -0400 (EDT) Cc: freebsd-net@freebsd.org, 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: Mon, 20 Aug 2012 12:31:43 -0000 On Friday, August 17, 2012 6:58:58 pm Peter Jeremy wrote: > On 2012-Aug-17 11:48:17 -0400, John Baldwin wrote: > >Hmm, I think I see the issue. It doesn't export the existing lease info to > >the script when running the FAIL action. I just tested this change and it > >removed the old IP on my laptop when I tested it just now. > > I did some investigating during the week and came to pretty much the > same patch. But the existing "don't remove an existing address" > behaviour looked like a design decision and I went digging to find > exactly what ip->client->active represented - and, in particular, > whether in could represent an address that dhclient hadn't added to > the interface. I did find that it could be read from the leases file > but didn't have time to fully work through the code. > > If you're happy that this patch can't incorrectly remove a pre-existing > IP address (I'm now reasonably confident that it can't), then I'm happy > that it otherwise works. I think it should be fine. It's a bit hard to infer exactly what the desired design is from OpenBSD's dhclient code now as it uses a different tack (they don't restart dhclient on link up, but leave the dhclient hanging around and it restarts its own state when the link goes up). -- John Baldwin