From bece39619bbf0edb4fbfffff2c8b041fd2576602 Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Wed, 27 Jun 2018 16:33:10 -0700 Subject: [PATCH] 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. --- src/scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scan.c b/src/scan.c index 00115d8b..9e033dac 100644 --- a/src/scan.c +++ b/src/scan.c @@ -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);