Can we remove the eloop exception listener?

Jouni Malinen j
Wed Jul 4 11:39:01 PDT 2012

On Mon, Jul 02, 2012 at 09:24:11PM -0700, Ben Greear wrote:
> On 06/30/2012 03:24 AM, Jouni Malinen wrote:
> > By the way, I just noticed that the poll() version of eloop seemed to
> > break WPS external registrar functionality (TCP socket used for HTTP;
> > i.e., something that needs both read and write events). I haven't had a
> > chance to look at closer details on what was happening, but the HTTP
> > connections were timing out in my tests. Going back to select() removed
> > the issue.
> I don't think I've ever used that.  Do you have any details on
> how to reproduce the problem and/or setup WPS external registrar?

sudo ./wpa_supplicant -Dnone -ieth0 -c wps.conf -ddK

(wps.conf can have just one line to enable the control interface, e.g.,
with "ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=admin")

shows this in the log:

HTTP: Timeout (c=0x1045148)
WPS ER: Failed to fetch device info

When starting ER in wpa_cli:

> wps_er_start 

with select(), wpa_cli shows this:

> wps_er_start 
<3>WPS-ER-AP-ADD 572cf82f-c957-5653-9b16-b5cfb298abf1 02:00:00:00:01:00 pri_dev_type=6-0050F204-1 wps_state=2 |WPS Access Point|Company||WAP|||

(that WPS-ER-AP-ADD event does not show up with poll()-based eloop due
to that HTTP timeout)

You'll need at least following entries in wpa_supplicant/.config for


(and also need at least one AP with WPS enabled in the same physical

The problem here seems to be in registered EVENT_TYPE_WRITE for
http_client_tx_ready() in src/wps/http_client.c not getting called which
makes the HTTP client fail to send the POST data. Changing POLLIN to
POLLOUT in eloop_sock_table_set_fds() for the writers table seems to fix

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list