policy: add steer-reject-timeout
authorDavid Bauer <mail@david-bauer.net>
Wed, 23 Feb 2022 22:44:57 +0000 (23:44 +0100)
committerDavid Bauer <mail@david-bauer.net>
Fri, 18 Mar 2022 20:46:29 +0000 (21:46 +0100)
Add a timeout in case a STA rejected a transition request. For this
configurable timeframe, usteer will refrain from steering the client
another time.

Signed-off-by: David Bauer <mail@david-bauer.net>
main.c
openwrt/usteer/files/etc/config/usteer
openwrt/usteer/files/etc/init.d/usteer
policy.c
ubus.c
usteer.h

diff --git a/main.c b/main.c
index f46ec78d6112199cbd8e55b296bfd9f8a8973631..6371c75deb9796401659f076108eb7bd30045fa1 100644 (file)
--- a/main.c
+++ b/main.c
@@ -97,6 +97,8 @@ void usteer_init_defaults(void)
        config.initial_connect_delay = 0;
        config.remote_node_timeout = 10;
 
+       config.steer_reject_timeout = 60000;
+
        config.roam_kick_delay = 10000;
        config.roam_process_timeout = 5 * 1000;
        config.roam_scan_tries = 3;
index 38c0e7749abb0651b69c497fb69b45a9113051aa..8243f305857e8127048bdb000c506ea6253eaf88 100644 (file)
@@ -65,6 +65,9 @@ config usteer
        # Timeout after which a station with snr < min_snr will be kicked
        #option min_snr_kick_delay 5000
 
+       # Timeout (ms) for which a client will not be steered after rejecting a BSS-transition-request
+       #option steer_reject_timeout 60000
+
        # Timeout (in ms) after which a association following a disassociation is not seen
        # as a roam
        #option roam_process_timeout 5000
index 22273ef6aeaad0242558dd6fd197fe535decbb6d..30c558ebf9d61f25ea3ad4d388bd08f59766555f 100755 (executable)
@@ -81,7 +81,7 @@ uci_usteer() {
                load_balancing_threshold band_steering_threshold \
                remote_update_interval remote_node_timeout\
                min_connect_snr min_snr min_snr_kick_delay signal_diff_threshold \
-               initial_connect_delay roam_process_timeout\
+               initial_connect_delay steer_reject_timeout roam_process_timeout\
                roam_kick_delay roam_scan_tries roam_scan_timeout \
                roam_scan_snr roam_scan_interval \
                roam_trigger_snr roam_trigger_interval \
index b99a361fae94930529711729e745359a5490f95b..6399a7820f426efd8d0e7e00f13bb0e9c85f2ad2 100644 (file)
--- a/policy.c
+++ b/policy.c
@@ -385,6 +385,7 @@ usteer_local_node_roam_check(struct usteer_local_node *ln, struct uevent *ev)
        list_for_each_entry(si, &ln->node.sta_info, node_list) {
                if (si->connected != STA_CONNECTED || si->signal >= min_signal ||
                        si->kick_time ||
+                       (si->bss_transition_response.status_code && current_time - si->bss_transition_response.timestamp < config.steer_reject_timeout) ||
                    current_time - si->roam_kick < config.roam_trigger_interval) {
                        usteer_roam_set_state(si, ROAM_TRIGGER_IDLE, ev);
                        continue;
diff --git a/ubus.c b/ubus.c
index 79401e0c48597c6350309bfbb5b882f27ef886a4..a90e5ea7e1e0be81516c2fa573d4947e7e6e956b 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -165,6 +165,7 @@ struct cfg_item {
        _cfg(I32, min_connect_snr), \
        _cfg(I32, min_snr), \
        _cfg(U32, min_snr_kick_delay), \
+       _cfg(U32, steer_reject_timeout), \
        _cfg(U32, roam_process_timeout), \
        _cfg(I32, roam_scan_snr), \
        _cfg(U32, roam_scan_tries), \
index 6a58659221bb46a1e2809b27ead985ab81494c4e..dfc9544bf0fb0e46cf3f8d85a7868c9dafc55965 100644 (file)
--- a/usteer.h
+++ b/usteer.h
@@ -174,6 +174,8 @@ struct usteer_config {
        int32_t min_connect_snr;
        uint32_t signal_diff_threshold;
 
+       uint32_t steer_reject_timeout;
+
        int32_t roam_scan_snr;
        uint32_t roam_process_timeout;