aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-10-19 13:26:01 (GMT)
committerJouni Malinen <j@w1.fi>2013-10-19 13:26:01 (GMT)
commitbceb843108f92fdea51d9cf7a2f7f03758cbdf10 (patch)
treeffeed54832988d8ab258240bcd02e295813b5eed
parentb6077964c20188461f25bfdc096f4f7cfad8c0c2 (diff)
downloadhostap-bceb843108f92fdea51d9cf7a2f7f03758cbdf10.zip
hostap-bceb843108f92fdea51d9cf7a2f7f03758cbdf10.tar.gz
hostap-bceb843108f92fdea51d9cf7a2f7f03758cbdf10.tar.bz2
Send CTRL-RSP command response before processing EAPOL update
This is what the original implementation did years ago, but the move to using separate control interface backends re-ordered the implementation to process EAPOL notification first. Use a registered timeout to allow the ctrl_iface response to be sent out first to get somewhat faster response time and to avoid pending operations that could result in ctrl_iface response and unsolicited event messages from getting mixed up. Signed-hostap: Jouni Malinen <j@w1.fi>
-rw-r--r--wpa_supplicant/ctrl_iface.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 7b3af28..2dc64dd 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -5197,12 +5197,18 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
}
+static void wpas_ctrl_eapol_response(void *eloop_ctx, void *timeout_ctx)
+{
+ struct wpa_supplicant *wpa_s = eloop_ctx;
+ eapol_sm_notify_ctrl_response(wpa_s->eapol);
+}
+
+
char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
char *buf, size_t *resp_len)
{
char *reply;
const int reply_size = 4096;
- int ctrl_rsp = 0;
int reply_len;
if (os_strncmp(buf, WPA_CTRL_RSP, os_strlen(WPA_CTRL_RSP)) == 0 ||
@@ -5541,8 +5547,14 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
if (wpa_supplicant_ctrl_iface_ctrl_rsp(
wpa_s, buf + os_strlen(WPA_CTRL_RSP)))
reply_len = -1;
- else
- ctrl_rsp = 1;
+ else {
+ /*
+ * Notify response from timeout to allow the control
+ * interface response to be sent first.
+ */
+ eloop_register_timeout(0, 0, wpas_ctrl_eapol_response,
+ wpa_s, NULL);
+ }
} else if (os_strcmp(buf, "RECONFIGURE") == 0) {
if (wpa_supplicant_reload_configuration(wpa_s))
reply_len = -1;
@@ -5740,9 +5752,6 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
reply_len = 5;
}
- if (ctrl_rsp)
- eapol_sm_notify_ctrl_response(wpa_s->eapol);
-
*resp_len = reply_len;
return reply;
}