scan: fix scan state check

The state of scan is split between the two variables sc->state
and sc->start_cmd_id. Not checking start_cmd_id used to cause
sending a scan request while periodic scan was just triggered
resulting in EBUSY.
This commit is contained in:
Tim Kourt 2018-06-27 16:33:10 -07:00 committed by Denis Kenzior
parent 93a113f551
commit bece39619b
1 changed files with 1 additions and 1 deletions

View File

@ -343,7 +343,7 @@ static uint32_t scan_common(uint32_t ifindex, bool passive,
if (l_queue_length(sc->requests) > 0)
goto done;
if (sc->state != SCAN_STATE_NOT_RUNNING)
if (sc->state != SCAN_STATE_NOT_RUNNING || sc->start_cmd_id)
goto done;
sc->start_cmd_id = scan_send_start(&sr->start_cmd, scan_triggered, sc);