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 <[email protected]>
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)
{
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);