Date: Mon, 20 Aug 2012 08:28:48 -0400 From: John Baldwin <jhb@freebsd.org> To: Peter Jeremy <peter@rulingia.com> Cc: freebsd-net@freebsd.org, Yuri <yuri@rawbw.com> Subject: Re: System doesn't detect unplugged network cable and doesn't set interface up properly with DHCP Message-ID: <201208200828.48457.jhb@freebsd.org> In-Reply-To: <20120817225857.GA2377@server.rulingia.com> References: <4FFF3683.7020107@rawbw.com> <201208171148.17427.jhb@freebsd.org> <20120817225857.GA2377@server.rulingia.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, August 17, 2012 6:58:58 pm Peter Jeremy wrote: > On 2012-Aug-17 11:48:17 -0400, John Baldwin <jhb@freebsd.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208200828.48457.jhb>