]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Use actual number of supported AKMs for AP setup
authorSascha Hauer <s.hauer@pengutronix.de>
Thu, 30 May 2024 12:31:05 +0000 (14:31 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 11 Jul 2024 15:30:21 +0000 (18:30 +0300)
Since 0ce1545dcb8 ("nl80211: Determine maximum number of supported
AKMs") we get the maximum number of supported AKMs from the kernel.
Let's use that instead of the legacy NL80211_MAX_NR_AKM_SUITES when
setting up AP mode operation.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
src/drivers/driver_nl80211.c

index 32007ca594b24fbf948387cadf2b3968eb98e6b2..2063d5aca3b98bdcdeb6f8d519e488de89b92ea0 100644 (file)
@@ -5168,10 +5168,10 @@ static int wpa_driver_nl80211_set_ap(void *priv,
                   params->key_mgmt_suites);
        num_suites = wpa_key_mgmt_to_suites(params->key_mgmt_suites,
                                            suites, ARRAY_SIZE(suites));
-       if (num_suites > NL80211_MAX_NR_AKM_SUITES)
+       if ((unsigned int) num_suites > drv->capa.max_num_akms)
                wpa_printf(MSG_DEBUG,
-                          "nl80211: Not enough room for all AKM suites (num_suites=%d > NL80211_MAX_NR_AKM_SUITES)",
-                          num_suites);
+                          "nl80211: Not enough room for all AKM suites (num_suites=%d > %d)",
+                          num_suites, drv->capa.max_num_akms);
        else if (num_suites &&
                 nla_put(msg, NL80211_ATTR_AKM_SUITES, num_suites * sizeof(u32),
                         suites))