]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MBO: Fix the allowed range of mbo_assoc_disallow values
authorJanusz Dziedzic <janusz.dziedzic@gmail.com>
Sun, 24 Oct 2021 19:48:34 +0000 (21:48 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 12 Dec 2021 20:07:19 +0000 (22:07 +0200)
This parameter was added with the commit message indicating the valid
reason code values to be 1-5, but with the implementation allowed only
1. There are five defined reason code values for the Association
Disallowed attribute, so extend the allowed range to cover all those
values.

Fixes: fb9a1c3e285d ("hostapd: Add MBO IE to Beacon, Probe Response, Association Response")
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
hostapd/ctrl_iface.c
tests/hwsim/test_mbo.py

index 9c7527d08d0a045e36abdf1ad4d026cd6393efc2..a00dc4f028e09c986596ea3a1f98eb182b431e40 100644 (file)
@@ -1504,7 +1504,7 @@ static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd)
                        return -1;
 
                val = atoi(value);
-               if (val < 0 || val > 1)
+               if (val < 0 || val > MBO_ASSOC_DISALLOW_REASON_LOW_RSSI)
                        return -1;
 
                hapd->mbo_assoc_disallow = val;
index 36efd6a0e0cedbb583264afead844646518f4308..d4426ac4be50cea68965286800cb28921b9c4024 100644 (file)
@@ -203,8 +203,8 @@ def test_mbo_assoc_disallow(dev, apdev, params):
     hapd2 = hostapd.add_ap(apdev[1], {"ssid": "MBO", "mbo": "1"})
 
     logger.debug("Set mbo_assoc_disallow with invalid value")
-    if "FAIL" not in hapd1.request("SET mbo_assoc_disallow 2"):
-        raise Exception("Set mbo_assoc_disallow for AP1 succeeded unexpectedly with value 2")
+    if "FAIL" not in hapd1.request("SET mbo_assoc_disallow 6"):
+        raise Exception("Set mbo_assoc_disallow for AP1 succeeded unexpectedly with value 6")
 
     logger.debug("Disallow associations to AP1 and allow association to AP2")
     if "OK" not in hapd1.request("SET mbo_assoc_disallow 1"):