3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 23:09:34 +01:00

auto-t: wpas.py: don't require strict match on wait_for_event

wait_for_event was checking the event string presence in the rx_data
array which meant the event string had to match perfectly to any
received events. This poses problems with events that include additional
information which the caller may not be able to know or does not care
about. For example:

DPP-RX src=02:00:00:00:02:00 freq=2437 type=11

Waiting for this event previously would require the caller know src, freq,
and type. If the caller only wants to wait for DPP-RX, it can now do that.
This commit is contained in:
James Prestwood 2022-01-04 10:18:52 -08:00 committed by Denis Kenzior
parent eb84b2a6e8
commit cbe454a46a

View File

@ -70,9 +70,10 @@ class Wpas:
while True: while True:
context.iteration(may_block=True) context.iteration(may_block=True)
if event in self._rx_data: for e in self._rx_data:
GLib.source_remove(timeout) if event in e:
return self._rx_data GLib.source_remove(timeout)
return self._rx_data
if self._wait_timed_out: if self._wait_timed_out:
raise TimeoutError('waiting for wpas event timed out') raise TimeoutError('waiting for wpas event timed out')