scan: Fix failure handling in common scan triggering logic

Fix incorrect usage of the caller’s scan triggered callback.
In case of a failure, destroy scan request and notify caller
about the issue by returning zero scan id instead of calling
callers’ scan triggered callback with an error code.
This commit is contained in:
Tim Kourt 2018-11-26 16:00:00 -08:00 committed by Denis Kenzior
parent d9c89e89c6
commit 0536a9bdd5
1 changed files with 1 additions and 1 deletions

View File

@ -480,7 +480,7 @@ static uint32_t scan_common(uint32_t ifindex, bool passive,
if (!scan_request_send_next(sc, sr))
goto done;
scan_request_trigger_failed(sr, -EIO);
scan_request_free(sr);
return 0;
done:
l_queue_push_tail(sc->requests, sr);