diff mbox series

wpa_auth: Reconfigure group rekey timer upon wpa_reconfig

Message ID CY8PR19MB7252D35DCF5B38A4697E166BDBC92@CY8PR19MB7252.namprd19.prod.outlook.com
State Superseded
Headers show
Series wpa_auth: Reconfigure group rekey timer upon wpa_reconfig | expand

Commit Message

Nikita Chernikov March 3, 2025, 3:19 p.m. UTC
From 98487e906944c456f2a784d43f47125fd9796f85 Mon Sep 17 00:00:00 2001
From: Nikita Chernikov <nchernikov@maxlinear.com>
Date: Fri, 14 Feb 2025 18:04:28 +0530
Subject: [PATCH] wpa_auth: Reconfigure group rekey timer upon wpa_reconfig
To: hostap@lists.infradead.org

During BSS reload (ctrl iface or SIGHUP) need to reconfigure the
group rekey timer, as it might change for specific BSS via the new config file.
If not reconfigured, the previous running timer will need to expire in order to apply
the new group rekey timeout.

Signed-off-by: Nikita Chernikov <nchernikov@maxlinear.com>
---
 src/ap/wpa_auth.c    | 14 ++++++++++++++
 1 files changed, 14 insertions(+)

--
2.17.1
diff mbox series

Patch

diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
index ffb88a03f..671eacd2c 100644
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
@@ -652,6 +652,18 @@  static void wpa_auth_pmksa_free_cb(struct rsn_pmksa_cache_entry *entry,
      wpa_auth_for_each_sta(wpa_auth, wpa_auth_pmksa_clear_cb, entry);
 }
 
+static void wpa_reconfig_group_rekey_timer(struct wpa_authenticator *wpa_auth)
+{
+     if (!wpa_auth)
+           return;
+
+     eloop_cancel_timeout(wpa_rekey_ptk, wpa_auth, NULL);
+
+     if (wpa_auth->conf.wpa_group_rekey) {
+           eloop_register_timeout(wpa_auth->conf.wpa_group_rekey,
+                              0, wpa_rekey_gtk, wpa_auth, NULL);
+     }
+}
 
 static int wpa_group_init_gmk_and_counter(struct wpa_authenticator *wpa_auth,
                                struct wpa_group *group)
@@ -990,6 +1002,8 @@  int wpa_reconfig(struct wpa_authenticator *wpa_auth,
      group->GInit = false;
      wpa_group_sm_step(wpa_auth, group);
 
+     wpa_reconfig_group_rekey_timer(wpa_auth);
+
      return 0;
 }