From owner-freebsd-current@FreeBSD.ORG Wed Aug 22 12:46:20 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CA65106566B; Wed, 22 Aug 2012 12:46:20 +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 4E5F08FC0C; Wed, 22 Aug 2012 12:46:20 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9B340B97D; Wed, 22 Aug 2012 08:46:19 -0400 (EDT) From: John Baldwin To: Slawa Olhovchenkov Date: Wed, 22 Aug 2012 08:43:52 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <20120821095527.GA33206@hell.ukr.net> <201208211725.23381.jhb@freebsd.org> <20120821231630.GF88729@zxy.spb.ru> In-Reply-To: <20120821231630.GF88729@zxy.spb.ru> MIME-Version: 1.0 Content-Type: Text/Plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable Message-Id: <201208220843.52847.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 22 Aug 2012 08:46:19 -0400 (EDT) Cc: Garrett Cooper , freebsd-current@freebsd.org, lev@freebsd.org, current@freebsd.org, Peter Jeremy Subject: Re: r239356: does it mean, that synchronous dhcp and dhcplcinet with disabled devd gone? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Aug 2012 12:46:20 -0000 On Tuesday, August 21, 2012 7:16:30 pm Slawa Olhovchenkov wrote: > On Tue, Aug 21, 2012 at 05:25:23PM -0400, John Baldwin wrote: >=20 > > On Tuesday, August 21, 2012 9:34:31 am John Baldwin wrote: > > > On Tuesday, August 21, 2012 7:53:08 am Lev Serebryakov wrote: > > > > Hello, Garrett. > > > > You wrote 21 =C1=D7=C7=D5=D3=D4=C1 2012 =C7., 15:40:35: > > > >=20 > > > > GC>> Try reverting r239356 -- if that works, then please let jhb@ k= now. > > > > LS> I'm confused by this commit, because it seems (from comment = alone), > > > > LS> that dhclient will not work without devd anymore (with "synch= ronous > > > > LS> dhcp" option in rc.conf). > > > > LS> Am I right? > > > > And if I'm right about understanding what this change does, it is > > > > POLA violation for sure. Both consequences: unable to use dhcclient > > > > without devd (user will need to restart it by hands after each cab= le > > > > unplugging event) and removing IP address from interface on cable > > > > unplugging or other interface down event but before lease is expir= ed. > > > >=20 > > > > If I'm right in understanding this commit, I vote to back it out = and > > > > find better solution, may be, two new options: one to remove IP and > > > > one to exit on interface down. And default behavior should be OLD > > > > ONE about IP address in any case and OLD ONE about exit in case wh= en > > > > dhclient isn't started by devd, but by rc scripts directly. > > >=20 > > > Humm. devd is the more common case, and we explicitly don't use devd= to start=20 > > > dhclient on boot even when devd is enabled (so out of the box dhcp wo= uld first=20 > > > be started by rc, but would be restarted by devd). > > >=20 > > > Another option is to rework dhclient to work like it does on OpenBSD = where it > > > renews its lease if the link bounces, but to not exit when the link g= oes down. =20 > > > That case would fix the currently broken case that you unplug your ca= ble, take=20 > > > your laptop over to another network (e.g. take it home if suspend/res= ume=20 > > > works), then plug it back in and are still stuck with your old IP. > >=20 > > Ok, this is what I came up with, somewhat loosely based on OpenBSD's dh= client. > > I tested that it survives the following: > >=20 > > - Unplugging/replugging does not kill an existing ssh session > > - Using ifconfig down/up does not kill an existing ssh session > > - Plugging into a different network does cause dhclient to negotiate > > a new lease on the new network >=20 > Assign address on interface manualy cause exiting dhcpclient? Hmm, it does. Is that by design? That seems to be the old behavior of the client from my reading of the code as well. =2D-=20 John Baldwin