netif_carrier_on/eapol processing race condition
Tue Nov 9 00:46:08 PST 2010
we are working with some old-version wpa_supplicant, and facing a
subtle race condition, but it looks like it exists in the latest
hostap git as well.
upon association, our driver calls netif_carrier_on() and sends an
the problem is, netif_carrier_on() clears the __LINK_STATE_NOCARRIER
flag immediately, but schedules a later work to do its actual work
(setting the qdiscs).
thus, the association event might come before the qdiscs are ready
(IFF_LOWER_UP flag will be up, though).
moreover, some eapol packet might come in this period, when the driver
is associated, but before the qdiscs are ready. this situation will
result in dropping of the eapol response.
a similar situation can be reproduced by disabling the call to
netif_carrier_on (i.e. the carrier will always be off).
the problem is somewhat similar to the "Delay processing of EAPOL
frames when not associated" patch
does delaying the processing of eapol frames until the carrier is up
sounds like a reasonable solution?
(i implemented such a patch, which seems to work, but it uses some
ugly workaround in order to identify the actual RTM_NEWLINK event)
More information about the Hostap