Re: Issue with wpa_cli and 'PING' check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 01, 2017 at 04:41:43PM -0800, Ben Greear wrote:
> While debugging some strange issues, I noticed that my wpa_cli
> in monitor mode was disconnecting because the PING failed.
> 
> It looks like the reason it fails goes something like this:
> 
> wpa_cli: ping
> wpa_supplicant:  do things, post logging message to wpa-cli
> wpa_supplicant:  read ping & reply with pong
> wpa_cli:  reads 'logging message', decides PONG fails, and disconnects.

Looks like wpa_cli -a<script> case is not using two control interface
sockets like the interactive case does to avoid this.. I guess that
should be fixed.

> So, nasty race I guess?

Yeah.. wpa_ctrl_request() tries to avoid this with the msg_cb() design
based on reply starting with '<', but that is not really perfect and
everything that really matters from robustness view point should use a
separate socket for receiving messages (registered with "ATTACH") and
for commands (like this "PING" case) to avoid any chance of interpreting
an unsolicited event message as a response to a pending command.

In case of wpa_cli, this would need changes in wpa_cli_open_connection()
to open mon_conn for the action script case as well and then make
wpa_cli_action() use mon_conn instad of ctrl for wpa_ctrl_get_fd().. Or
something very similar to that.

-- 
Jouni Malinen                                            PGP id EFC895FA

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux