diff options
| author | Olof Sivertsson | 2018-01-17 12:32:09 +0000 |
|---|---|---|
| committer | Jo-Philipp Wich | 2018-01-17 12:34:08 +0000 |
| commit | fb749bf51a7855ee955fc221acdc51b94231db2b (patch) | |
| tree | 46fc3e4061e8e6cc85a61888676c91d71a780f98 | |
| parent | 75c572074f272f0b983d888f7dd23ee59719c6b0 (diff) | |
| download | iwinfo-fb749bf51a7855ee955fc221acdc51b94231db2b.tar.gz | |
nl80211: do not block when driver aborts scan
Drivers may abort a scan by calling cfg80211_scan_done() with a struct
cfg80211_scan_info that sets aborted to true.
To avoid blocking forever consider both NL80211_CMD_NEW_SCAN_RESULTS
and NL80211_CMD_SCAN_ABORTED when waiting for scan results.
Tested with Broadcom's bcmdhd driver.
Signed-off-by: Olof Sivertsson <olof.sivertsson@zenterio.com>
[rebased on top of variadic nl80211_wait()]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
| -rw-r--r-- | iwinfo_nl80211.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index 895b6ee..99177e7 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -2103,7 +2103,8 @@ static int nl80211_get_scanlist_nl(const char *ifname, char *buf, int *len) if (nl80211_request(ifname, NL80211_CMD_TRIGGER_SCAN, 0, NULL, NULL)) goto out; - if (nl80211_wait("nl80211", "scan", NL80211_CMD_NEW_SCAN_RESULTS)) + if (nl80211_wait("nl80211", "scan", + NL80211_CMD_NEW_SCAN_RESULTS, NL80211_CMD_SCAN_ABORTED)) goto out; if (nl80211_request(ifname, NL80211_CMD_GET_SCAN, NLM_F_DUMP, |