[PATCH 2/5] mka: disable peer detection timeout for PSK mode

Sabrina Dubroca sd at queasysnail.net
Wed Nov 2 08:38:36 PDT 2016


The first peer may take a long time to come up.  In PSK mode we are
basically in a p2p system, and we cannot know when a peer will join
the key exchange.  Wait indefinitely, and let the administrator decide
if they want to abort.

Signed-off-by: Sabrina Dubroca <sd at queasysnail.net>
---
 src/pae/ieee802_1x_kay.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c
index 63bbd135213a..c76968dc7b78 100644
--- a/src/pae/ieee802_1x_kay.c
+++ b/src/pae/ieee802_1x_kay.c
@@ -3337,8 +3337,17 @@ ieee802_1x_kay_create_mka(struct ieee802_1x_kay *kay, struct mka_key_name *ckn,
 	usecs = os_random() % (MKA_HELLO_TIME * 1000);
 	eloop_register_timeout(0, usecs, ieee802_1x_participant_timer,
 			       participant, NULL);
-	participant->mka_life = MKA_LIFE_TIME / 1000 + time(NULL) +
-		usecs / 1000000;
+
+	/* Disable MKA lifetime for PSK mode.
+	 * The peer(s) can take a long time to come up, because we
+	 * create a "standby" MKA, and we need it to remain live until
+	 * some peer appears.
+	 */
+	if (mode != PSK) {
+		participant->mka_life = MKA_LIFE_TIME / 1000 +
+					time(NULL) +
+					usecs / 1000000;
+	}
 
 	return participant;
 
-- 
2.10.1




More information about the Hostap mailing list