policy: always accept assoc requests by default
authorFelix Fietkau <nbd@nbd.name>
Mon, 12 Apr 2021 10:14:05 +0000 (12:14 +0200)
committerFelix Fietkau <nbd@nbd.name>
Mon, 12 Apr 2021 10:15:28 +0000 (12:15 +0200)
Only steer using probe responses to avoid connection issues

Signed-off-by: Felix Fietkau <nbd@nbd.name>
openwrt/usteer/files/etc/init.d/usteer
policy.c
ubus.c
usteer.h

index d73c622097ce842dd10a631be1dae14500ffbe0a..09429cfa249ccec1cda48e832a06f8d2f67835ab 100755 (executable)
@@ -53,6 +53,7 @@ uci_usteer() {
 
        uci_option_to_json_bool "$cfg" syslog
        uci_option_to_json_bool "$cfg" load_kick_enabled
+       uci_option_to_json_bool "$cfg" assoc_steering
        uci_option_to_json_string "$cfg" node_up_script
 
        for opt in \
index c528bfa650715a77bce04f508af61de75ea6c43a..f083dc3d4efd85ea5ae68c76e249eebe451b23d4 100644 (file)
--- a/policy.c
+++ b/policy.c
@@ -143,6 +143,9 @@ usteer_check_request(struct sta_info *si, enum usteer_event_type type)
        if (type == EVENT_TYPE_AUTH)
                return true;
 
+       if (type == EVENT_TYPE_ASSOC && !config.assoc_steering)
+               return true;
+
        if (si->stats[type].blocked_cur >= config.max_retry_band) {
                MSG_T_STA("max_retry_band", si->sta->addr,
                        "max retry (%u) exceeded\n", config.max_retry_band);
diff --git a/ubus.c b/ubus.c
index 2aa82e5146698eca522927fca2581f5d2250c5d6..9bd1cc0708ddb2d8394b2afb5d90608ecd3be09d 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -148,6 +148,7 @@ struct cfg_item {
        _cfg(U32, load_balancing_threshold), \
        _cfg(U32, band_steering_threshold), \
        _cfg(U32, remote_update_interval), \
+       _cfg(BOOL, assoc_steering), \
        _cfg(I32, min_connect_snr), \
        _cfg(I32, min_snr), \
        _cfg(I32, roam_scan_snr), \
index 0041886eb13151d75474621b8a9d461e91e7a56e..2efc3383984280ae042b6cdcdd078ad8f83560be 100644 (file)
--- a/usteer.h
+++ b/usteer.h
@@ -126,6 +126,8 @@ struct usteer_config {
        uint32_t max_retry_band;
        uint32_t seen_policy_timeout;
 
+       bool assoc_steering;
+
        uint32_t band_steering_threshold;
        uint32_t load_balancing_threshold;