]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MLD STA: Indicate AP MLD address in CTRL-EVENT-CONNECTED
authorAleti Nageshwar Reddy <quic_anageshw@quicinc.com>
Thu, 8 Sep 2022 14:44:17 +0000 (20:14 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 15 Sep 2022 13:00:51 +0000 (16:00 +0300)
Append the AP MLD address to CTRL-EVENT-CONNECTED when the current
connection uses MLO.

Signed-off-by: Aleti Nageshwar Reddy <quic_anageshw@quicinc.com>
wpa_supplicant/ctrl_iface.c
wpa_supplicant/wpa_supplicant.c

index 1f1c98b97dfbdecd7df74f54d9df62495522fd6a..00c5b0ff916254610fb21570f4e8b1d4dc3bb2d9 100644 (file)
@@ -2537,12 +2537,21 @@ static int wpa_supplicant_ctrl_iface_status(struct wpa_supplicant *wpa_s,
                                          wpa_s->current_ssid->ssid_len) : "");
                if (wpa_s->wpa_state == WPA_COMPLETED) {
                        struct wpa_ssid *ssid = wpa_s->current_ssid;
+                       char mld_addr[50];
+
+                       mld_addr[0] = '\0';
+                       if (wpa_s->valid_links)
+                               os_snprintf(mld_addr, sizeof(mld_addr),
+                                           " ap_mld_addr=" MACSTR,
+                                           MAC2STR(wpa_s->ap_mld_addr));
+
                        wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_CONNECTED
                                     "- connection to " MACSTR
-                                    " completed %s [id=%d id_str=%s]",
+                                    " completed %s [id=%d id_str=%s]%s",
                                     MAC2STR(wpa_s->bssid), "(auth)",
                                     ssid ? ssid->id : -1,
-                                    ssid && ssid->id_str ? ssid->id_str : "");
+                                    ssid && ssid->id_str ? ssid->id_str : "",
+                                    mld_addr);
                }
        }
 #endif /* ANDROID */
index 4e79402b7c506f3aaa4b62a354207a87276bd163..e085391e2ed5deb76a2ba598d9a062e26cafad85 100644 (file)
@@ -985,6 +985,13 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
        if (state == WPA_COMPLETED && wpa_s->new_connection) {
                struct wpa_ssid *ssid = wpa_s->current_ssid;
                int fils_hlp_sent = 0;
+               char mld_addr[50];
+
+               mld_addr[0] = '\0';
+               if (wpa_s->valid_links)
+                       os_snprintf(mld_addr, sizeof(mld_addr),
+                                   " ap_mld_addr=" MACSTR,
+                                   MAC2STR(wpa_s->ap_mld_addr));
 
 #ifdef CONFIG_SME
                if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) &&
@@ -997,11 +1004,11 @@ void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
 
 #if defined(CONFIG_CTRL_IFACE) || !defined(CONFIG_NO_STDOUT_DEBUG)
                wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_CONNECTED "- Connection to "
-                       MACSTR " completed [id=%d id_str=%s%s]",
+                       MACSTR " completed [id=%d id_str=%s%s]%s",
                        MAC2STR(wpa_s->bssid),
                        ssid ? ssid->id : -1,
                        ssid && ssid->id_str ? ssid->id_str : "",
-                       fils_hlp_sent ? " FILS_HLP_SENT" : "");
+                       fils_hlp_sent ? " FILS_HLP_SENT" : "", mld_addr);
 #endif /* CONFIG_CTRL_IFACE || !CONFIG_NO_STDOUT_DEBUG */
                wpas_clear_temp_disabled(wpa_s, ssid, 1);
                wpa_s->consecutive_conn_failures = 0;