Date: Wed, 21 May 2003 14:23:01 +0200 (CEST) From: Martin Blapp <mb@imp.ch> To: Bruce M Simpson <bms@spc.org> Cc: hackers@FreeBSD.ORG Subject: Re: [PATCH] dhclient active interface detection patch Message-ID: <20030521141810.C7348@cvs.imp.ch> In-Reply-To: <20030521010903.GA23471@spc.org> References: <20030418132152.X6156@cvs.imp.ch> <20030418144504.B99028@sasami.jurai.net> <20030419011446.J95995@cvs.imp.ch> <20030521024232.P7348@cvs.imp.ch> <20030521010903.GA23471@spc.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi,
>
> Excellent work. However - we may wish to think about modifying it for
> use wiht 802.11 interfaces. Yesterday I got 4.7-RELEASE working on a
> friend's machine which is now acting as wireless backhaul from a building
> in Bow, East London with an antenna pointed at Hackney; from reboot,
> the machine associates with the AP in Hackney and invokes dhclient
> to get an IP from the AP once associated.
>
> But in order to get things to happen in the right order, I had to create
> a script /etc/start_if.wi0, and write a little program called 'waitforap'.
>
> I've attached it. It's not perfect, but it does the job; rather than
> attempting to perform a DHCPREQUEST broadcast before the interface is
> ready, it waits until wi0's status is 'associated'.
Hi,
Ehm. You should just use my dhclient patch and not need any furter scripts
and patches. I do just the same as you.
All you have to do is :
dhclient -nw wi0
Can you confirm that my patch works here too ?
+ if (ioctl(sock, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) {
+ /*
+ * Interface doesn't support SIOCGIFMEDIA, presume okay
+ */
+ close(sock);
+ return (1);
+ }
+ close(sock);
+
+ if (ifmr.ifm_count == 0) {
+ /*
+ * this is unexpected (to me), but we'll just assume
+ * that this means interface does not support SIOCGIFMEDIA
+ */
+ return (1);
+ }
+
+ if (ifmr.ifm_status & IFM_AVALID) {
+ if (ifmr.ifm_status & IFM_ACTIVE)
+ return (1);
+ } else
+ return (0);
+
+ return (0);
Martin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030521141810.C7348>
