From: Jouni Malinen Date: Fri, 6 Mar 2015 18:58:56 +0000 (+0200) Subject: mesh: Leave mesh in driver setup if initialization fails X-Git-Tag: hostap_2_4~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41312fc7ef42810894d937f233313e7d8a46022b;p=thirdparty%2Fhostap.git 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 --- 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; }