From 41312fc7ef42810894d937f233313e7d8a46022b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 6 Mar 2015 20:58:56 +0200 Subject: [PATCH] mesh: Leave mesh in driver setup if initialization fails It was possible to leave the driver in mesh point state if upper layer mesh initialization failed in wpa_supplicant_mesh_init(). With nl80211, this results in the vif being left in mesh point mode instead of restoring it to station mode. That seems to break normal functionality, e.g., for Public Action frame TX/RX. Fix this by restoring station mode on mesh failure path. This error could be triggered, e.g., with the following hwsim test case sequence: wpas_mesh_secure_sae_missing_password nfc_p2p_static_handover_tagdev_go_forced_freq Signed-off-by: Jouni Malinen --- wpa_supplicant/mesh.c | 1 + 1 file changed, 1 insertion(+) diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c index cf3676c22..33b4af38f 100644 --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c @@ -344,6 +344,7 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s, if (wpa_supplicant_mesh_init(wpa_s, ssid)) { wpa_msg(wpa_s, MSG_ERROR, "Failed to init mesh"); + wpa_drv_leave_mesh(wpa_s); ret = -1; goto out; } -- 2.47.2