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 <mail@david-bauer.net>
This commit is contained in:
David Bauer
2021-12-25 17:25:38 +01:00
parent 8e7b1ffc26
commit bbf133ff46
2 changed files with 3 additions and 1 deletions

View File

@@ -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;

View File

@@ -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;