[PATCH v2] AP: Skip GTK rekey on STA request when group rekeying is disabled

孟超 (Chao Meng) Chao.Meng at unisoc.com
Mon Aug 24 18:40:03 PDT 2026


update whitespace

From: Chao Meng <chao.meng at 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 at unisoc.com>
---
 src/ap/wpa_auth.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

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. */
--
2.21.0.windows.1

________________________________
 This email (including its attachments) is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Unauthorized use, dissemination, distribution or copying of this email or the information herein or taking any action in reliance on the contents of this email or the information herein, by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is strictly prohibited. If you are not the intended recipient, please do not read, copy, use or disclose any part of this e-mail to others. Please notify the sender immediately and permanently delete this e-mail and any attachments if you received it in error. Internet communications cannot be guaranteed to be timely, secure, error-free or virus-free. The sender does not accept liability for any errors or omissions.
本邮件及其附件具有保密性质,受法律保护不得泄露,仅发送给本邮件所指特定收件人。严禁非经授权使用、宣传、发布或复制本邮件或其内容。若非该特定收件人,请勿阅读、复制、 使用或披露本邮件的任何内容。若误收本邮件,请从系统中永久性删除本邮件及所有附件,并以回复邮件的方式即刻告知发件人。无法保证互联网通信及时、安全、无误或防毒。发件人对任何错漏均不承担责任。


More information about the Hostap mailing list