]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
dpp-nfc: Use --altchan value in handover server
authorJouni Malinen <jouni@codeaurora.org>
Tue, 11 Aug 2020 20:44:48 +0000 (23:44 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 11 Aug 2020 20:44:48 +0000 (23:44 +0300)
Use the alternative channel list in the handover server role when
processing an alternative proposal. This was previously done only in the
handover client role, but with the updated design, both roles act in a
similar manner for the case where the alternative channel list is
specified.

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

index 4027c5e232d7ee90f484acfd36918cd42c27256b..e0d11f412b765c8b728f944972e02bcb44caf867 100755 (executable)
@@ -467,6 +467,7 @@ def run_dpp_handover_client(handover, alt=False):
         summary("DPP carrier not seen in response - do not allow alternative proposal anymore")
     elif not dpp_found:
         summary("DPP carrier not seen in response - allow peer to initiate a new handover with different parameters")
+        handover.alt_proposal = True
         handover.my_crn_ready = False
         handover.my_crn = None
         handover.peer_crn = None
@@ -523,6 +524,7 @@ class HandoverServer(nfc.handover.HandoverServer):
                     resp = self._process_request_data(req)
                     if resp is None or len(resp) == 0:
                         summary("No handover select to send out - wait for a possible alternative handover request")
+                        handover.alt_proposal = True
                         req = bytearray()
                         continue
 
@@ -605,6 +607,11 @@ class HandoverServer(nfc.handover.HandoverServer):
                 if test_uri:
                     summary("TEST MODE: Using specified URI")
                     data = test_sel_uri if test_sel_uri else test_uri
+                elif handover.alt_proposal and handover.altchanlist:
+                    summary("Use alternative channel list while processing alternative proposal from peer")
+                    data = wpas_get_nfc_uri(start_listen=False,
+                                            chan_override=handover.altchanlist,
+                                            pick_channel=True)
                 else:
                     data = wpas_get_nfc_uri(start_listen=False,
                                             pick_channel=True)
@@ -918,6 +925,7 @@ class ConnectionHandover():
         self.my_uri = None
         self.peer_uri = None
         self.connected = False
+        self.alt_proposal = False
 
     def start_handover_server(self, llc):
         summary("Start handover server")