From: David Bauer Date: Wed, 17 Aug 2022 22:51:32 +0000 (+0200) Subject: policy: don't alter stats when remaining idle X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=8b10a4b296e78158fadcebdaa5b30019eba5d8e1;p=project%2Fusteer.git policy: don't alter stats when remaining idle Don't alter roam-sm stats when remaining idle. Previously, a roam-sm-event was registered when keeping the idle-state. Signed-off-by: David Bauer --- diff --git a/policy.c b/policy.c index 3d21f32..8c5d244 100644 --- a/policy.c +++ b/policy.c @@ -264,14 +264,15 @@ static void usteer_roam_set_state(struct sta_info *si, enum roam_trigger_state state, struct uevent *ev) { + /* NOP in case we remain idle */ + if (si->roam_state == state && si->roam_state == ROAM_TRIGGER_IDLE) { + si->roam_tries = 0; + return; + } + si->roam_event = current_time; if (si->roam_state == state) { - if (si->roam_state == ROAM_TRIGGER_IDLE) { - si->roam_tries = 0; - return; - } - si->roam_tries++; } else { si->roam_tries = 0;