wpa_ctrl_request: reenterable

Jouni Malinen j
Thu Nov 10 16:50:52 PST 2011

On Thu, Nov 10, 2011 at 12:19:25PM +0800, Huijun Gan wrote:
> For the function wpa_ctrl_request(), is it reenterable? What I mean
> is, does it work OK, if multi threads call this function on the same
> wpa_ctrl (i.e. the same socket fd)?

Whether that function itself can handle this is one question, but even
more important question would be to ask whether the same socket can be
used with multiple commands that may be issue more or less concurrently.
I've never tested this, but it sounds likely that you may hit getting
confusing results since the command result may not show up in the
correct thread. In other words, you'll likely better off opening
separate socket for each thread needing to access the control interface
or using some mechanism to enforce only a single concurrent command.
Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list