]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
dpp-nfc: Do not indicate no initial HS as failure if alt HR will be sent
authorJouni Malinen <jouni@codeaurora.org>
Thu, 30 Jul 2020 21:48:46 +0000 (00:48 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 30 Jul 2020 22:00:11 +0000 (01:00 +0300)
Do not use red color for the "No response receive" message in case
another HR will be sent after this.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
wpa_supplicant/examples/dpp-nfc.py

index 3bec4573a7da7137b27de3212164b222df336a4d..fcb65698756784ec763edfaffd0ddaffd8c94682 100755 (executable)
@@ -383,6 +383,8 @@ def run_dpp_handover_client(handover, alt=False):
             summary("No response received as expected since I'm the handover server")
         elif handover.alt_proposal_used and not alt:
             summary("No response received for initial proposal as expected since alternative proposal was also used")
+        elif handover.try_own and not alt:
+            summary("No response received for initial proposal as expected since alternative proposal will also be sent")
         else:
             summary("No response received", color=C_RED)
         run_client_alt(handover, alt)
@@ -490,7 +492,6 @@ class HandoverServer(nfc.handover.HandoverServer):
         self.sent_carrier = None
         self.ho_server_processing = False
         self.success = False
-        self.try_own = False
         self.llc = llc
         self.handover = handover
 
@@ -686,7 +687,7 @@ class HandoverServer(nfc.handover.HandoverServer):
             handover.hs_sent = True
         else:
             summary("Try to initiate with alternative parameters")
-            self.try_own = True
+            handover.try_own = True
             handover.hs_sent = False
             handover.no_alt_proposal = True
             if handover.client_thread:
@@ -856,8 +857,8 @@ def llcp_worker(llc, try_alt):
     else:
         print("Wait for handover to complete - press 'i' to initiate")
     while not handover.wait_connection and handover.srv.sent_carrier is None:
-        if handover.srv.try_own:
-            handover.srv.try_own = False
+        if handover.try_own:
+            handover.try_own = False
             summary("Try to initiate another handover with own parameters")
             handover.my_crn_ready = False
             handover.my_crn = None
@@ -905,6 +906,7 @@ class ConnectionHandover():
         self.i_m_selector = False
         self.start_client_alt = False
         self.terminate_on_hs_send_completion = False
+        self.try_own = False
 
     def start_handover_server(self, llc):
         summary("Start handover server")