usteer: fix uchannel.uc script

Once the uchannel.uc script sets its status to waiting, it becomes
defunct. The next invocation of the script will compare uptime to
state.uptime, and if the difference is less than 12h, it will change
state.uptime to the current uptime and return. As the script runs every
5 minutes, the difference will always be less than 12h.

Fix this by comparing uptime against state.changed rather than
state.uptime.

Fixes: WIFI-7613
Fixes: 670bc9d2e2 ("ucentral: development update")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
This commit is contained in:
Stijn Tintel
2022-04-13 17:02:35 +03:00
committed by John Crispin
parent 83b6ccf562
commit 19dbb1d5e3

View File

@@ -272,7 +272,7 @@ function youngest() {
let state = state_get();
if (state.status == "waiting" &&
(uptime - state.uptime < (12 * 60 * 60))) {
(uptime - state.changed < (12 * 60 * 60))) {
state_set(state);
return;
}