[PATCH] Handle EVENT_TX_WAIT_EXPIRE path for DPP push button

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

 



From: andrewrpope <andrew.pope@xxxxxxxxxxxxxx>

The DPP push button state machine will get stuck if an off-channel
PB announcement is cancelled via EVENT_TX_WAIT_EXPIRE. This commit
handles a TX_WAIT_EXPIRE by calling wpas_dpp_pb_next, moving the
state machine forward.

Signed-off-by: Andrew Pope <andrew.pope@xxxxxxxxxxxxxx>
---
 wpa_supplicant/dpp_supplicant.c | 10 ++++++++++
 wpa_supplicant/dpp_supplicant.h |  1 +
 wpa_supplicant/events.c         |  3 +++
 3 files changed, 14 insertions(+)

diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c
index 62059ccc8..f3994bfed 100644
--- a/wpa_supplicant/dpp_supplicant.c
+++ b/wpa_supplicant/dpp_supplicant.c
@@ -5509,6 +5509,16 @@ int wpas_dpp_ca_set(struct wpa_supplicant *wpa_s, const char *cmd)
 static int wpas_dpp_pb_announce(struct wpa_supplicant *wpa_s, int freq);
 static void wpas_dpp_pb_next(void *eloop_ctx, void *timeout_ctx);
 
+void wpas_dpp_push_button_tx_wait_expire(struct wpa_supplicant *wpa_s)
+{
+	if (!wpa_s->dpp_pb_announcement || wpa_s->dpp_pb_discovery_done)
+		return;
+
+	wpa_printf(MSG_DEBUG, "DPP: Failed to send push button announcement");
+	if (eloop_register_timeout(0, 0, wpas_dpp_pb_next, wpa_s, NULL) < 0)
+		wpas_dpp_push_button_stop(wpa_s);
+}
+
 
 static void wpas_dpp_pb_tx_status(struct wpa_supplicant *wpa_s,
 				  unsigned int freq, const u8 *dst,
diff --git a/wpa_supplicant/dpp_supplicant.h b/wpa_supplicant/dpp_supplicant.h
index e2bdd9d40..6066664da 100644
--- a/wpa_supplicant/dpp_supplicant.h
+++ b/wpa_supplicant/dpp_supplicant.h
@@ -46,5 +46,6 @@ int wpas_dpp_ca_set(struct wpa_supplicant *wpa_s, const char *cmd);
 int wpas_dpp_conf_set(struct wpa_supplicant *wpa_s, const char *cmd);
 int wpas_dpp_push_button(struct wpa_supplicant *wpa_s, const char *cmd);
 void wpas_dpp_push_button_stop(struct wpa_supplicant *wpa_s);
+void wpas_dpp_push_button_tx_wait_expire(struct wpa_supplicant *wpa_s);
 
 #endif /* DPP_SUPPLICANT_H */
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index a7c56f771..9f4f9445c 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -7082,6 +7082,9 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 #ifdef CONFIG_DPP
 		wpas_dpp_tx_wait_expire(wpa_s);
 #endif /* CONFIG_DPP */
+#ifdef CONFIG_DPP3
+		wpas_dpp_push_button_tx_wait_expire(wpa_s);
+#endif /* CONFIG_DPP3 */
 #ifdef CONFIG_NAN_USD
 		wpas_nan_usd_tx_wait_expire(wpa_s);
 #endif /* CONFIG_NAN_USD */
-- 
2.34.1


_______________________________________________
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