From owner-cvs-all Mon Jan 21 7:41:44 2002 Delivered-To: cvs-all@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id A6F3837B404; Mon, 21 Jan 2002 07:41:32 -0800 (PST) Received: from fledge.watson.org (fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.11.6/8.11.5) with SMTP id g0LFfQD69983; Mon, 21 Jan 2002 10:41:26 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Mon, 21 Jan 2002 10:41:26 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Ruslan Ermilov 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 In-Reply-To: <20020121173406.A77567@sunbay.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 mtu 1500 ether 00:d0:b7:68:3f:50 media: Ethernet autoselect (none) status: no carrier fxp1: flags=8843 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 ) 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