aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSabrina Dubroca <sd@queasysnail.net>2016-08-15 09:43:42 (GMT)
committerJouni Malinen <j@w1.fi>2016-08-28 18:31:28 (GMT)
commit34dbe90ac519debdd08f39ff7798f5df2db5119e (patch)
tree4754d53075efc1f184da95d49a581cecc8d9111e
parent0dabf79b5d044ce8a4a188b854a720adb88cbda9 (diff)
downloadhostap-34dbe90ac519debdd08f39ff7798f5df2db5119e.zip
hostap-34dbe90ac519debdd08f39ff7798f5df2db5119e.tar.gz
hostap-34dbe90ac519debdd08f39ff7798f5df2db5119e.tar.bz2
mka: Share a single delete mka implementation
Share mka deletion implementation in ieee802_1x_participant_timer() for the cak_life and mka_life expiration cases. Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
-rw-r--r--src/pae/ieee802_1x_kay.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c
index bbeab55..918c540 100644
--- a/src/pae/ieee802_1x_kay.c
+++ b/src/pae/ieee802_1x_kay.c
@@ -2359,27 +2359,16 @@ static void ieee802_1x_participant_timer(void *eloop_ctx, void *timeout_ctx)
participant = (struct ieee802_1x_mka_participant *)eloop_ctx;
kay = participant->kay;
if (participant->cak_life) {
- if (now > participant->cak_life) {
- kay->authenticated = FALSE;
- kay->secured = FALSE;
- kay->failed = TRUE;
- ieee802_1x_kay_delete_mka(kay, &participant->ckn);
- return;
- }
+ if (now > participant->cak_life)
+ goto delete_mka;
}
/* should delete MKA instance if there are not live peers
* when the MKA life elapsed since its creating */
if (participant->mka_life) {
if (dl_list_empty(&participant->live_peers)) {
- if (now > participant->mka_life) {
- kay->authenticated = FALSE;
- kay->secured = FALSE;
- kay->failed = TRUE;
- ieee802_1x_kay_delete_mka(kay,
- &participant->ckn);
- return;
- }
+ if (now > participant->mka_life)
+ goto delete_mka;
} else {
participant->mka_life = 0;
}
@@ -2467,6 +2456,14 @@ static void ieee802_1x_participant_timer(void *eloop_ctx, void *timeout_ctx)
eloop_register_timeout(MKA_HELLO_TIME / 1000, 0,
ieee802_1x_participant_timer,
participant, NULL);
+
+ return;
+
+delete_mka:
+ kay->authenticated = FALSE;
+ kay->secured = FALSE;
+ kay->failed = TRUE;
+ ieee802_1x_kay_delete_mka(kay, &participant->ckn);
}