From 4d546184249e4c27e514043407c2a52d96972dd0 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 31 Jul 2020 01:09:31 +0300 Subject: [PATCH] dpp-nfc: Stop only_one run after failed handover attempt Do not require connection handover to succeed before stopping the loop in the only_one case. Signed-off-by: Jouni Malinen --- wpa_supplicant/examples/dpp-nfc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/examples/dpp-nfc.py b/wpa_supplicant/examples/dpp-nfc.py index fcb656987..02a7e2f45 100755 --- a/wpa_supplicant/examples/dpp-nfc.py +++ b/wpa_supplicant/examples/dpp-nfc.py @@ -907,6 +907,7 @@ class ConnectionHandover(): self.start_client_alt = False self.terminate_on_hs_send_completion = False self.try_own = False + self.connected = False def start_handover_server(self, llc): summary("Start handover server") @@ -939,6 +940,7 @@ def llcp_startup(llc): def llcp_connected(llc): summary("P2P LLCP connected") global handover + handover.connected = True handover.srv.start() if init_on_touch or not no_input: handover.client_thread = threading.Thread(target=llcp_worker, @@ -1129,8 +1131,8 @@ def main(): summary("clf.connect failed: " + str(e)) break - if only_one and handover.srv and handover.srv.success: - raise SystemExit + if only_one and handover.connected: + break except KeyboardInterrupt: raise SystemExit