Blame SOURCES/macsec-0014-mka-Disable-peer-detection-timeout-for-PSK-mode.patch

6c9f0c
From 008e224dbb518f44aac46b0c8e55448bd907e43d Mon Sep 17 00:00:00 2001
6c9f0c
Message-Id: <008e224dbb518f44aac46b0c8e55448bd907e43d.1488376601.git.dcaratti@redhat.com>
6c9f0c
From: Sabrina Dubroca <sd@queasysnail.net>
6c9f0c
Date: Wed, 2 Nov 2016 16:38:36 +0100
6c9f0c
Subject: [PATCH] mka: Disable peer detection timeout for PSK mode
6c9f0c
6c9f0c
The first peer may take a long time to come up. In PSK mode we are
6c9f0c
basically in a p2p system, and we cannot know when a peer will join the
6c9f0c
key exchange. Wait indefinitely, and let the administrator decide if
6c9f0c
they want to abort.
6c9f0c
6c9f0c
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
6c9f0c
---
6c9f0c
 src/pae/ieee802_1x_kay.c | 12 ++++++++++--
6c9f0c
 1 file changed, 10 insertions(+), 2 deletions(-)
6c9f0c
6c9f0c
diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c
6c9f0c
index 2841b10..19b2c2f 100644
6c9f0c
--- a/src/pae/ieee802_1x_kay.c
6c9f0c
+++ b/src/pae/ieee802_1x_kay.c
6c9f0c
@@ -3339,8 +3339,16 @@ ieee802_1x_kay_create_mka(struct ieee802_1x_kay *kay, struct mka_key_name *ckn,
6c9f0c
 	usecs = os_random() % (MKA_HELLO_TIME * 1000);
6c9f0c
 	eloop_register_timeout(0, usecs, ieee802_1x_participant_timer,
6c9f0c
 			       participant, NULL);
6c9f0c
-	participant->mka_life = MKA_LIFE_TIME / 1000 + time(NULL) +
6c9f0c
-		usecs / 1000000;
6c9f0c
+
6c9f0c
+	/* Disable MKA lifetime for PSK mode.
6c9f0c
+	 * The peer(s) can take a long time to come up, because we
6c9f0c
+	 * create a "standby" MKA, and we need it to remain live until
6c9f0c
+	 * some peer appears.
6c9f0c
+	 */
6c9f0c
+	if (mode != PSK) {
6c9f0c
+		participant->mka_life = MKA_LIFE_TIME / 1000 + time(NULL) +
6c9f0c
+			usecs / 1000000;
6c9f0c
+	}
6c9f0c
 
6c9f0c
 	return participant;
6c9f0c
 
6c9f0c
-- 
6c9f0c
2.7.4
6c9f0c