scan: Don't immediately retry periodic scan on error

On a periodic scan trigger error we already set rearm to true, rearm the
timer instead of retrying immediately.
This commit is contained in:
Andrew Zaborowski 2017-03-14 16:11:33 +01:00 committed by Denis Kenzior
parent 1392a80d34
commit 5869b74c2e
1 changed files with 3 additions and 3 deletions

View File

@ -85,6 +85,7 @@ struct scan_results {
};
static bool start_next_scan_request(struct scan_context *sc);
static void scan_periodic_rearm(struct scan_context *sc);
static bool scan_context_match(const void *a, const void *b)
{
@ -464,9 +465,8 @@ static void scan_periodic_done(struct l_genl_msg *msg, void *user_data)
l_warn("Periodic scan could not be triggered: %s (%d)",
strerror(-err), -err);
sc->sp.retry = true;
start_next_scan_request(sc);
if (!start_next_scan_request(sc))
scan_periodic_rearm(sc);
return;
}