[PATCH] MKA: Do not delay transmitting MKPDU at startup

Greg Goblirsch gregg at thinklogical.com
Fri Apr 29 06:18:47 PDT 2022


9.4.3 Determining liveness

NOTE 1—The specified use of the Live and Potential Peer Lists thus permits rapid removal of participants that are no longer active or attached to the LAN while reducing the number of MKPDUs transmitted during group formation. For example, a new participant will be admitted to an established group after receiving, then transmitting, one MKPDU.

The delay will ensure this will not happen.

Signed-off-by: Greg Goblirsch <gregg at thinklogical.com>

@@ -3635,7 +3634,6 @@ ieee802_1x_kay_create_mka(struct ieee802_1x_kay *kay,
                          enum mka_created_mode mode, bool is_authenticator)
 {
        struct ieee802_1x_mka_participant *participant;
-       unsigned int usecs;
 
        wpa_printf(MSG_DEBUG,
                   "KaY: Create MKA (ifname=%s mode=%s authenticator=%s)",
@@ -3773,9 +3771,6 @@ ieee802_1x_kay_create_mka(struct ieee802_1x_kay *kay,
 
        dl_list_add(&kay->participant_list, &participant->list);
 
-       usecs = os_random() % (kay->mka_hello_time * 1000);
-       eloop_register_timeout(0, usecs, ieee802_1x_participant_timer,
-                              participant, NULL);
 
        /* Disable MKA lifetime for PSK mode.
         * The peer(s) can take a long time to come up, because we
@@ -3783,11 +3778,20 @@ ieee802_1x_kay_create_mka(struct ieee802_1x_kay *kay,
         * some peer appears.
         */
        if (mode != PSK) {
-               participant->mka_life = MKA_LIFE_TIME / 1000 + time(NULL) +
-                       usecs / 1000000;
+               participant->mka_life = MKA_LIFE_TIME / 1000 + time(NULL);
        }
        participant->mode = mode;
 
+       if (participant->retry_count < MAX_RETRY_CNT ||
+           participant->mode == PSK) {
+               ieee802_1x_participant_send_mkpdu(participant);
+               participant->retry_count++;
+       }
+
+       eloop_register_timeout(kay->mka_hello_time / 1000, 0,
+                              ieee802_1x_participant_timer,
+                              participant, NULL);
+
        return participant;
 
 fail:


More information about the Hostap mailing list