Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Aug 2012 16:54:14 +0400
From:      Slawa Olhovchenkov <slw@zxy.spb.ru>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Garrett Cooper <yanegomi@gmail.com>, freebsd-current@freebsd.org, lev@freebsd.org, current@freebsd.org, Peter Jeremy <peterjeremy@acm.org>
Subject:   Re: r239356: does it mean, that synchronous dhcp and dhcplcinet with disabled devd gone?
Message-ID:  <20120822125414.GX98910@zxy.spb.ru>
In-Reply-To: <201208220843.52847.jhb@freebsd.org>
References:  <20120821095527.GA33206@hell.ukr.net> <201208211725.23381.jhb@freebsd.org> <20120821231630.GF88729@zxy.spb.ru> <201208220843.52847.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Aug 22, 2012 at 08:43:52AM -0400, John Baldwin wrote:

> 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:
> > 
> > > 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 августа 2012 г., 15:40:35:
> > > > > 
> > > > > GC>> Try reverting r239356 -- if that works, then please let jhb@ know.
> > > > > LS>   I'm confused by  this commit, because it seems (from comment alone),
> > > > > LS> that  dhclient  will not work without devd anymore (with "synchronous
> > > > > 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 cable
> > > > >  unplugging event) and removing IP address from interface on cable
> > > > >  unplugging or other interface down event but before lease is expired.
> > > > > 
> > > > >   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 when
> > > > >  dhclient isn't started by devd, but by rc scripts directly.
> > > > 
> > > > Humm.  devd is the more common case, and we explicitly don't use devd to start 
> > > > dhclient on boot even when devd is enabled (so out of the box dhcp would first 
> > > > be started by rc, but would be restarted by devd).
> > > > 
> > > > 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 goes down.  
> > > > That case would fix the currently broken case that you unplug your cable, take 
> > > > your laptop over to another network (e.g. take it home if suspend/resume 
> > > > works), then plug it back in and are still stuck with your old IP.
> > > 
> > > Ok, this is what I came up with, somewhat loosely based on OpenBSD's dhclient.
> > > I tested that it survives the following:
> > > 
> > > - 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
> > 
> > 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.

I am don't know, but this is comfortable.
It is not desirable lost this behavior.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120822125414.GX98910>