From 2afb9b1a5800d7eb2057f36ab7fffa721cd24619 Mon Sep 17 00:00:00 2001 From: xinpeng wang Date: Thu, 28 Jul 2022 16:19:42 +0800 Subject: [PATCH] dbus: Add dbus notify when wpa_s->key_mgmt changes For WPA2/WPA3 authentication mode, wpa_supplicant needs to notify CurrentAuthMode property change when wpa_s->key_mgmt changes, so NetworkManager can judge whether it needs to request a password based on this. Call wpas_notify_auth_changed() when starting a new connection item, i.e., after having updated wpa_s->key_mgmt. Signed-off-by: xinpeng wang --- wpa_supplicant/sme.c | 1 + wpa_supplicant/wpa_supplicant.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index e1abb8b1b..5698b3da8 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -1027,6 +1027,7 @@ static void sme_auth_start_cb(struct wpa_radio_work *work, int deinit) wpa_s->rsnxe_len = 0; sme_send_authentication(wpa_s, cwork->bss, cwork->ssid, 1); + wpas_notify_auth_changed(wpa_s); } diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index ce3583fde..2739e93df 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -4254,6 +4254,8 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit) wpa_supplicant_initiate_eapol(wpa_s); if (old_ssid != wpa_s->current_ssid) wpas_notify_network_changed(wpa_s); + if (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)) + wpas_notify_auth_changed(wpa_s); }