From: David Bauer Date: Sat, 25 Dec 2021 16:25:38 +0000 (+0100) Subject: policy: fix not selecting better candidate on request X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=bbf133ff466e814ed75ecdb300b3d889a2bf8beb;p=project%2Fusteer.git policy: fix not selecting better candidate on request A unset bitmask leads to the candidate selection always return no candidate, even if there is one. To select a better candidate regardless of it's classification, provide a bitmask containing all selection criteria. Signed-off-by: David Bauer --- diff --git a/event.h b/event.h index 57b35a0..86d9232 100644 --- a/event.h +++ b/event.h @@ -30,6 +30,8 @@ enum uevent_select_reason { UEV_SELECT_REASON_LOAD, }; +#define UEV_SELECT_REASON_ALL ((1 << UEV_SELECT_REASON_NUM_ASSOC) | (1 << UEV_SELECT_REASON_SIGNAL) | (1 << UEV_SELECT_REASON_LOAD)) + struct uevent { enum uevent_type type; enum uevent_reason reason; diff --git a/policy.c b/policy.c index 08ab902..04a1b3c 100644 --- a/policy.c +++ b/policy.c @@ -192,7 +192,7 @@ usteer_check_request(struct sta_info *si, enum usteer_event_type type) goto out; } - if (!find_better_candidate(si, &ev, 0)) + if (!find_better_candidate(si, &ev, UEV_SELECT_REASON_ALL)) goto out; ev.reason = UEV_REASON_BETTER_CANDIDATE;