policy: don't select better candidate with bad signal

Don't select a node as a better candidate where a STA has insufficient
signal to. This is the case when the roam_trigger_snr is greater than
the projected signal of the client.

This stops clients from being selected to roam to a node where the
signal is not sufficient to maintain the connection. A selection might
otherwise happen e.g. due to better channel load on the remote node.

Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
David Bauer
2021-12-21 14:09:15 +01:00
parent 3c1dd5155d
commit 7e999e0874

View File

@@ -72,6 +72,18 @@ below_max_assoc(struct sta_info *si)
return !node->max_assoc || node->n_assoc < node->max_assoc;
}
static bool
over_min_signal(struct sta_info *si)
{
if (config.min_snr && si->signal < usteer_snr_to_signal(si->node, config.min_snr))
return false;
if (config.roam_trigger_snr && si->signal < usteer_snr_to_signal(si->node, config.roam_trigger_snr))
return false;
return true;
}
static uint32_t
is_better_candidate(struct sta_info *si_cur, struct sta_info *si_new)
{
@@ -80,6 +92,9 @@ is_better_candidate(struct sta_info *si_cur, struct sta_info *si_new)
if (!below_max_assoc(si_new))
return 0;
if (!over_min_signal(si_new))
return 0;
if (below_assoc_threshold(si_cur, si_new) &&
!below_assoc_threshold(si_new, si_cur))
reasons |= (1 << UEV_SELECT_REASON_NUM_ASSOC);