diff mbox series

AP: Skip GTK rekey on STA request when group rekeying is disabled

Message ID 84b3ed6b48c8406d95e6318c5e90e724@BJMBX02.spreadtrum.com
State New
Headers show
Series AP: Skip GTK rekey on STA request when group rekeying is disabled | expand

Commit Message

Chao Meng Aug. 24, 2026, 6:31 a.m. UTC
From 9c5aa0b43886addd1ac08440628ebd64b7bdbee5 Mon Sep 17 00:00:00 2001
From: Chao Meng <chao.meng@unisoc.com>
Date: Mon, 24 Aug 2026 14:20:04 +0800
Subject: [PATCH] AP: Skip GTK rekey on STA request when group rekeying is
 disabled

wpa_receive() unconditionally processed EAPOL-Key Request frames for GTK
rekeying received from a STA, even when the AP was configured with
wpa_group_rekey=0 to disable periodic group rekeying.

Add a guard on wpa_auth->conf.wpa_group_rekey before canceling the rekey
timeout and triggering a new GTK rekey. When group rekeying is
administratively disabled, log an informational message and ignore the
request.

Signed-off-by: Chao Meng <chao.meng@unisoc.com>
---
 src/ap/wpa_auth.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

--
diff mbox series

Patch

diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
index d736d1bc9..5f32f8da1 100644
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
@@ -2005,15 +2005,20 @@  void wpa_receive(struct wpa_authenticator *wpa_auth,
 LOGGER_INFO,
 "received EAPOL-Key Request for GTK rekeying");

-eloop_cancel_timeout(wpa_rekey_gtk,
-     wpa_get_primary_auth(wpa_auth),
-     NULL);
-if (wpa_auth_gtk_rekey_in_process(wpa_auth))
-wpa_auth_logger(wpa_auth, NULL, LOGGER_DEBUG,
-"skip new GTK rekey - already in process");
-else
-wpa_rekey_gtk(wpa_get_primary_auth(wpa_auth),
-      NULL);
+if (wpa_auth->conf.wpa_group_rekey){
+eloop_cancel_timeout(wpa_rekey_gtk,
+     wpa_get_primary_auth(wpa_auth),
+     NULL);
+if (wpa_auth_gtk_rekey_in_process(wpa_auth))
+wpa_auth_logger(wpa_auth, NULL, LOGGER_DEBUG,
+"skip new GTK rekey - already in process");
+else
+wpa_rekey_gtk(wpa_get_primary_auth(wpa_auth),
+      NULL);
+} else{
+wpa_auth_logger(wpa_auth, NULL, LOGGER_INFO,
+"skip new GTK rekey - group rekeying disabled");
+}
 }
 } else {
 /* Do not allow the same key replay counter to be reused. */