wpa_cli ping-pong and power management

Alon Bar-Lev alon.barlev
Sat Nov 1 00:31:16 PDT 2008


Thank you for the response.
I now can locate the select you mentioned.
I tried to modify the code to recognize the disconnect and found that
the control socket is dgram... So thee is no way  to know that the
peer is down except trying to ping-pong.
Will you accept an option to make the control socket stream?

Alon.

On 10/31/08, Jouni Malinen <j at w1.fi> wrote:
> 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 at lists.shmoo.com
>  http://lists.shmoo.com/mailman/listinfo/hostap
>



More information about the Hostap mailing list