Set interface state as inactive if mesh bringup fails

The STATUS command showed the interface state as SCANNING even if mesh
bringup fails. This incorrect interface status can mislead
scripts/applications that rely on interface status to bring up different
type of virtual interfaces (AP/MESH) on a single radio.

Fix this by setting the interface status as INACTIVE if mesh bringup
fails.

Signed-off-by: Hari Chandrakanthan <quic_haric@quicinc.com>
This commit is contained in:
Hari Chandrakanthan 2023-03-21 20:47:27 +05:30 committed by Jouni Malinen
parent a4af796248
commit 5349a45d32

View file

@ -2515,6 +2515,7 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
if (bss)
ssid->frequency = bss->freq;
if (wpa_supplicant_join_mesh(wpa_s, ssid) < 0) {
wpa_supplicant_set_state(wpa_s, WPA_INACTIVE);
wpa_msg(wpa_s, MSG_ERROR, "Could not join mesh");
return;
}