Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jan 2002 10:41:26 -0500 (EST)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Ruslan Ermilov <ru@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/net if.c if.h route.h rtsock.c         src/share/man/man4 route.4 src/sbin/route route.c
Message-ID:  <Pine.NEB.3.96L.1020121103802.69509E-100000@fledge.watson.org>
In-Reply-To: <20020121173406.A77567@sunbay.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 21 Jan 2002, Ruslan Ermilov wrote:

> On Mon, Jan 21, 2002 at 10:13:13AM -0500, Robert Watson wrote:
> > 
> > On Mon, 21 Jan 2002, Ruslan Ermilov wrote:
> > 
> > > On Fri, Jan 18, 2002 at 02:04:11PM -0500, Robert Watson wrote:
> > > > Any chance this also could send out link state changes?  I'd be very
> > > > interested in modifying dhclient to watch for routing socket announcements
> > > > regarding the link going up and down, offering the opportunity to start
> > > > dhcp in a timely manner...
> > > > 
> > > BSD always sent RTM_IFINFO for up/down events, and since net/if.c,v 1.83
> > > FreeBSD also sends these for MTU changes.
> > 
> > Hmm. I always thought this was only for administrative up/down events, not
> > link up/down events.  However, if I'm wrong, it should be easy to make
> > dhclient DTRT :-).
> > 
> I'm talking about IFF_UP thing here, not sure what do you mean.

I'm interested in getting events when the link status changes.  I.e., when
status goes from 'no carrier' on ethernet to 'active':

fxp0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        ether 00:d0:b7:68:3f:50 
        media: Ethernet autoselect (none)
        status: no carrier
fxp1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 192.168.50.1 netmask 0xffffff00 broadcast 192.168.50.255
        inet6 fe80::2d0:b7ff:fe68:4a8c%fxp1 prefixlen 64 scopeid 0x2 
        ether 00:d0:b7:68:4a:8c 
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active

Is that an event I can currently collect using the routing socket event
interface?  What I'd like to do is have dhclient do is the following:

(1) When starting up attempt DHCP on 'status: no carrier' interfaces
    briefly, to see if they come to life, but go to sleep quickly if it's
    no carrier.  That way the boot isn't blocked if dhclient can't work.

(2) Listen on the routing socket to pick up status event changes, and if
    dhclient currently has no live configuration for the interface, to
    wake up and try again immediately when the status goes active.  That
    way, if you plug in the ethernet cable, DHCP occurs immediately.

Both Windows 2000 and Mac OS X do this, although using a different event
model, I believe.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Project
robert@fledge.watson.org      NAI Labs, Safeport Network Services



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1020121103802.69509E-100000>