[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hostap
Subject:    Re: wpa_cli ping-pong and power management
From:       Jouni Malinen <j () w1 ! fi>
Date:       2008-10-31 17:02:30
Message-ID: 20081031170230.GU3923 () jm ! kir ! nu
[Download RAW message or body]

On Fri, Oct 31, 2008 at 06:00:51PM +0200, Alon Bar-Lev wrote:

> At least Gentoo network init script [1] uses wpa_cli with a script [2]
> to simulate ifplugd events for wpa_supplicant enabled interfaces.
> Can it be done better using scripts with current wpa_supplicant
> offering? (Without forking new processes every time and without waking
> up the process).

wpa_cli can be used in three "modes": interactive, action monitor,
command line tool. As far as I can tell, alarm(1) is only used in the
interactive case and Gentoo script does not use it (-a on the wpa_cli
command line indicates use of action monitor operation).

Action monitor uses a select() loop while waiting for new messages.
However, it does have a PING operation to test whether the connection is
still available. This is currently hardcoded to be done every two
seconds. Unlike the alarm() in interactive mode, I would agree on this
action monitor case benefiting from optimization from the viewpoint of
power management.

At minimum, the 2 second ping interval could be made configurable, but
it could also be possible to change the select() call to catch
wpa_supplicant exiting bit more reliably (well, at least in case this is
used on Linux/BSD).

-- 
Jouni Malinen                                            PGP id EFC895FA
_______________________________________________
HostAP mailing list
HostAP@lists.shmoo.com
http://lists.shmoo.com/mailman/listinfo/hostap
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic