diff mbox series

[6/9] netdev: support HANDSHAKE_EVENT_REKEY_COMPLETE

Message ID 20230111201543.397692-6-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/9] eapol: set secure on message 2/4 properly | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Jan. 11, 2023, 8:15 p.m. UTC
In try_handshake_complete() we return early if all the keys had
been installed before (initial associations). For rekeys we can
now emit the REKEY_COMPLETE event which lets AP mode reset the
rekey timer for that station.
---
 src/netdev.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/src/netdev.c b/src/netdev.c
index fc8a2afa..035dbd00 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -1469,8 +1469,13 @@  static void netdev_setting_keys_failed(struct netdev_handshake_state *nhs,
 
 static void try_handshake_complete(struct netdev_handshake_state *nhs)
 {
-	if (nhs->ptk_installed && nhs->gtk_installed && nhs->igtk_installed &&
-			!nhs->complete) {
+	if (nhs->ptk_installed && nhs->gtk_installed && nhs->igtk_installed) {
+		if (nhs->complete) {
+			handshake_event(&nhs->super,
+					HANDSHAKE_EVENT_REKEY_COMPLETE);
+			return;
+		}
+
 		nhs->complete = true;
 
 		if (handshake_event(&nhs->super, HANDSHAKE_EVENT_COMPLETE))