fb7f665
From e54691106b29f41aa3081b00eb4f48e411cebc72 Mon Sep 17 00:00:00 2001
fb7f665
Message-Id: <e54691106b29f41aa3081b00eb4f48e411cebc72.1488376602.git.dcaratti@redhat.com>
fb7f665
From: Badrish Adiga H R <badrish.adigahr@gmail.com>
fb7f665
Date: Fri, 6 Jan 2017 15:27:10 +0530
fb7f665
Subject: [PATCH] mka: Some bug fixes for MACsec in PSK mode
fb7f665
fb7f665
Issue:
fb7f665
------
fb7f665
The test setup has 2 peers running MACsec in PSK mode, Peer A with
fb7f665
MAC address higher than MAC Address of peer B. Test sequence is
fb7f665
1. Peer B starts with actor_priority 255
fb7f665
2. Peer A starts with priority 16, becomes key server.
fb7f665
3. Peer A stops..
fb7f665
4. Peer A restarts with priority 255, but because of the stale values
fb7f665
participant->is_key_server(=TRUE) and participant->is_elected(=TRUE)
fb7f665
it continues to remain as Key Server.
fb7f665
5. For peer B, key server election happens and since it has lower MAC
fb7f665
address as compared to MAC address of A, it becomes the key server.
fb7f665
Now we have 2 key servers in CA and is not correct.
fb7f665
fb7f665
Root-cause & fix:
fb7f665
-----------------
fb7f665
When number of live peers become 0, the flags such lrx, ltx, orx,
fb7f665
otx, etc. need to be cleared. In MACsec PSK mode, these stale values
fb7f665
create problems while re-establishing CA.
fb7f665
fb7f665
Signed-off-by: Badrish Adiga H R <badrish.adigahr@gmail.com>
fb7f665
---
fb7f665
 src/pae/ieee802_1x_kay.c | 6 ++++++
fb7f665
 1 file changed, 6 insertions(+)
fb7f665
fb7f665
diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c
fb7f665
index 79a6878..92fd7ba 100644
fb7f665
--- a/src/pae/ieee802_1x_kay.c
fb7f665
+++ b/src/pae/ieee802_1x_kay.c
fb7f665
@@ -2378,6 +2378,12 @@ static void ieee802_1x_participant_timer(void *eloop_ctx, void *timeout_ctx)
fb7f665
 			participant->advised_capability =
fb7f665
 				MACSEC_CAP_NOT_IMPLEMENTED;
fb7f665
 			participant->to_use_sak = FALSE;
fb7f665
+			participant->ltx = FALSE;
fb7f665
+			participant->lrx = FALSE;
fb7f665
+			participant->otx = FALSE;
fb7f665
+			participant->orx = FALSE;
fb7f665
+			participant->is_key_server = FALSE;
fb7f665
+			participant->is_elected = FALSE;
fb7f665
 			kay->authenticated = TRUE;
fb7f665
 			kay->secured = FALSE;
fb7f665
 			kay->failed = FALSE;
fb7f665
-- 
fb7f665
2.7.4
fb7f665