policy: only select nodes with better signal when roaming
When determining a new node within the roam state machine, require the destination node to have a better reported signal from the client. Otherwise, the roam state machine might trigger a roam action for a unsuitable destination node. Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
15
policy.c
15
policy.c
@@ -95,7 +95,7 @@ is_better_candidate(struct sta_info *si_cur, struct sta_info *si_new)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct sta_info *
|
static struct sta_info *
|
||||||
find_better_candidate(struct sta_info *si_ref, struct uevent *ev)
|
find_better_candidate(struct sta_info *si_ref, struct uevent *ev, uint32_t required_criteria)
|
||||||
{
|
{
|
||||||
struct sta_info *si;
|
struct sta_info *si;
|
||||||
struct sta *sta = si_ref->sta;
|
struct sta *sta = si_ref->sta;
|
||||||
@@ -118,6 +118,9 @@ find_better_candidate(struct sta_info *si_ref, struct uevent *ev)
|
|||||||
if (is_better_candidate(si, si_ref))
|
if (is_better_candidate(si, si_ref))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (!(reasons & required_criteria))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (ev) {
|
if (ev) {
|
||||||
ev->si_other = si;
|
ev->si_other = si;
|
||||||
ev->select_reasons = reasons;
|
ev->select_reasons = reasons;
|
||||||
@@ -189,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))
|
if (!find_better_candidate(si, &ev, 0))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
ev.reason = UEV_REASON_BETTER_CANDIDATE;
|
ev.reason = UEV_REASON_BETTER_CANDIDATE;
|
||||||
@@ -272,7 +275,7 @@ usteer_roam_trigger_sm(struct sta_info *si)
|
|||||||
if (current_time - si->roam_event < config.roam_scan_interval)
|
if (current_time - si->roam_event < config.roam_scan_interval)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (find_better_candidate(si, &ev) ||
|
if (find_better_candidate(si, &ev, (1 << UEV_SELECT_REASON_SIGNAL)) ||
|
||||||
si->roam_scan_done > si->roam_event) {
|
si->roam_scan_done > si->roam_event) {
|
||||||
usteer_roam_set_state(si, ROAM_TRIGGER_SCAN_DONE, &ev);
|
usteer_roam_set_state(si, ROAM_TRIGGER_SCAN_DONE, &ev);
|
||||||
break;
|
break;
|
||||||
@@ -289,7 +292,7 @@ usteer_roam_trigger_sm(struct sta_info *si)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ROAM_TRIGGER_IDLE:
|
case ROAM_TRIGGER_IDLE:
|
||||||
if (find_better_candidate(si, &ev)) {
|
if (find_better_candidate(si, &ev, (1 << UEV_SELECT_REASON_SIGNAL))) {
|
||||||
usteer_roam_set_state(si, ROAM_TRIGGER_SCAN_DONE, &ev);
|
usteer_roam_set_state(si, ROAM_TRIGGER_SCAN_DONE, &ev);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -304,7 +307,7 @@ usteer_roam_trigger_sm(struct sta_info *si)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (find_better_candidate(si, &ev))
|
if (find_better_candidate(si, &ev, (1 << UEV_SELECT_REASON_SIGNAL)))
|
||||||
usteer_roam_set_state(si, ROAM_TRIGGER_WAIT_KICK, &ev);
|
usteer_roam_set_state(si, ROAM_TRIGGER_WAIT_KICK, &ev);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -454,7 +457,7 @@ usteer_local_node_kick(struct usteer_local_node *ln)
|
|||||||
if (is_more_kickable(kick1, si))
|
if (is_more_kickable(kick1, si))
|
||||||
kick1 = si;
|
kick1 = si;
|
||||||
|
|
||||||
tmp = find_better_candidate(si, NULL);
|
tmp = find_better_candidate(si, NULL, 0);
|
||||||
if (!tmp)
|
if (!tmp)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user