]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Do not try to start/join RSN IBSS without CONFIG_IBSS_RSN=y
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 28 Oct 2016 16:33:20 +0000 (19:33 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 28 Oct 2016 16:33:20 +0000 (19:33 +0300)
Previously, a build without IBSS RSN support tried to start/join an IBSS
even if the profile was configured with RSN parameters. This does not
work and resulted in quite confusing debug log. Make this clearer by
explicitly checking for this case and reject the connection attempt with
a clearer debug log entry instead of trying something that is known to
fail.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant.c

index 99e9196706919f4bcbcf0d2e9d4a66adbb42977b..17f057a3a7a435fb694a33d2f995dfbbf6089dd2 100644 (file)
@@ -1047,6 +1047,16 @@ struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
                        continue;
                }
 
+#ifndef CONFIG_IBSS_RSN
+               if (ssid->mode == WPAS_MODE_IBSS &&
+                   !(ssid->key_mgmt & (WPA_KEY_MGMT_NONE |
+                                       WPA_KEY_MGMT_WPA_NONE))) {
+                       wpa_dbg(wpa_s, MSG_DEBUG,
+                               "   skip - IBSS RSN not supported in the build");
+                       continue;
+               }
+#endif /* !CONFIG_IBSS_RSN */
+
 #ifdef CONFIG_P2P
                if (ssid->p2p_group &&
                    !wpa_bss_get_vendor_ie(bss, P2P_IE_VENDOR_TYPE) &&
@@ -1332,6 +1342,17 @@ wpa_supplicant_pick_new_network(struct wpa_supplicant *wpa_s)
                {
                        if (wpas_network_disabled(wpa_s, ssid))
                                continue;
+#ifndef CONFIG_IBSS_RSN
+                       if (ssid->mode == WPAS_MODE_IBSS &&
+                           !(ssid->key_mgmt & (WPA_KEY_MGMT_NONE |
+                                               WPA_KEY_MGMT_WPA_NONE))) {
+                               wpa_msg(wpa_s, MSG_INFO,
+                                       "IBSS RSN not supported in the build - cannot use the profile for SSID '%s'",
+                                       wpa_ssid_txt(ssid->ssid,
+                                                    ssid->ssid_len));
+                               continue;
+                       }
+#endif /* !CONFIG_IBSS_RSN */
                        if (ssid->mode == IEEE80211_MODE_IBSS ||
                            ssid->mode == IEEE80211_MODE_AP ||
                            ssid->mode == IEEE80211_MODE_MESH)
index d9e28515d3a526ae61a55523997eeb234bf0abe3..5d6326a5d212a786e5fdd41d6cf08babc7f053c3 100644 (file)
@@ -1716,6 +1716,13 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
 #ifdef CONFIG_IBSS_RSN
        ibss_rsn_deinit(wpa_s->ibss_rsn);
        wpa_s->ibss_rsn = NULL;
+#else /* CONFIG_IBSS_RSN */
+       if (ssid->mode == WPAS_MODE_IBSS &&
+           !(ssid->key_mgmt & (WPA_KEY_MGMT_NONE | WPA_KEY_MGMT_WPA_NONE))) {
+               wpa_msg(wpa_s, MSG_INFO,
+                       "IBSS RSN not supported in the build");
+               return;
+       }
 #endif /* CONFIG_IBSS_RSN */
 
        if (ssid->mode == WPAS_MODE_AP || ssid->mode == WPAS_MODE_P2P_GO ||