]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
dpp-nfc: Fix recv_octets() regression
authorJouni Malinen <jouni@codeaurora.org>
Fri, 14 Aug 2020 21:19:46 +0000 (00:19 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 14 Aug 2020 21:26:21 +0000 (00:26 +0300)
The updated socket.poll() loop did not terminate properly in cases where
no response is available. Fix that to check for both False and None.

Fixes: 1733e356e421 ("dpp-nfc: Fix handover client wait for receiving handover select")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
wpa_supplicant/examples/dpp-nfc.py

index 83241330d621885c07e94055b36b70d07ee8f0cc..9f7fefb10d2017bb399ad0bd71cedcc3d845bbd8 100755 (executable)
@@ -280,7 +280,7 @@ class HandoverClient(nfc.handover.HandoverClient):
         msg = bytearray()
         while True:
             poll_timeout = 0.1 if timeout is None or timeout > 0.1 else timeout
-            if self.socket.poll('recv', poll_timeout) is None:
+            if not self.socket.poll('recv', poll_timeout):
                 if timeout:
                     timeout -= time.time() - start
                     if timeout <= 0: