diff mbox series

nl80211: Use actual number of supported AKMs

Message ID 20240530123105.1331257-1-s.hauer@pengutronix.de
State Accepted
Headers show
Series nl80211: Use actual number of supported AKMs | expand

Commit Message

Sascha Hauer May 30, 2024, 12:31 p.m. UTC
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.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 src/drivers/driver_nl80211.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jouni Malinen July 11, 2024, 3:53 p.m. UTC | #1
On Thu, May 30, 2024 at 02:31:05PM +0200, Sascha Hauer wrote:
> 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.

Thanks, applied.
diff mbox series

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 149f51a74..5b23a14a8 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -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 (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))