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:
2
event.h
2
event.h
@@ -30,6 +30,8 @@ enum uevent_select_reason {
|
|||||||
UEV_SELECT_REASON_LOAD,
|
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 {
|
struct uevent {
|
||||||
enum uevent_type type;
|
enum uevent_type type;
|
||||||
enum uevent_reason reason;
|
enum uevent_reason reason;
|
||||||
|
2
policy.c
2
policy.c
@@ -192,7 +192,7 @@ usteer_check_request(struct sta_info *si, enum usteer_event_type type)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!find_better_candidate(si, &ev, 0))
|
if (!find_better_candidate(si, &ev, UEV_SELECT_REASON_ALL))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
ev.reason = UEV_REASON_BETTER_CANDIDATE;
|
ev.reason = UEV_REASON_BETTER_CANDIDATE;
|
||||||
|
Reference in New Issue
Block a user