From: Jouni Malinen Date: Tue, 20 Dec 2022 15:29:19 +0000 (+0200) Subject: dpp-nfc: Try to request with alternative URL in additional cases X-Git-Tag: hostap_2_11~1351 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0f3f9cdcab6a0593e4cbfe1cca97c439c6182d07;p=thirdparty%2Fhostap.git dpp-nfc: Try to request with alternative URL in additional cases There was a race condition between the NFC handover requester and selector role processing that ended up not sending out the alternative proposal in some cases. Catch those at the end of run_dpp_handover_client() processing (or immediately after returning from that function without having sent out the alternative proposal). Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/examples/dpp-nfc.py b/wpa_supplicant/examples/dpp-nfc.py index 8e865f3fc..6cffe7186 100755 --- a/wpa_supplicant/examples/dpp-nfc.py +++ b/wpa_supplicant/examples/dpp-nfc.py @@ -359,7 +359,7 @@ def run_dpp_handover_client(handover, alt=False): summary("NFC Handover Request message for DPP: " + str(message)) if handover.peer_crn is not None and not alt: - summary("NFC handover request from peer was already received - do not send own") + summary("NFC handover request from peer was already received - do not send own[1]") return if handover.client: summary("Use already started handover client") @@ -382,7 +382,8 @@ def run_dpp_handover_client(handover, alt=False): handover.client = client if handover.peer_crn is not None and not alt: - summary("NFC handover request from peer was already received - do not send own") + summary("NFC handover request from peer was already received - do not send own[2] (except alt)") + run_client_alt(handover, alt) return summary("Sending handover request") @@ -876,6 +877,11 @@ def llcp_worker(llc, try_alt): if init_on_touch: summary("Starting handover client (init_on_touch)") dpp_handover_client(handover) + summary("llcp_worker init_on_touch processing completed: try_own={} hs_sent={} no_alt_proposal={} start_client_alt={}".format(handover.try_own, handover.hs_sent, handover.no_alt_proposal, handover.start_client_alt)) + if handover.start_client_alt and not handover.hs_sent: + summary("Try alternative handover request before exiting llcp_worker") + handover.start_client_alt = False + dpp_handover_client(handover, alt=True) summary("Exiting llcp_worker thread (init_on_touch)") return