]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Fix GO start on interface that has active station connection
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 21 Dec 2011 11:34:25 +0000 (13:34 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 21 Dec 2011 11:34:25 +0000 (13:34 +0200)
The active station connection triggered wpa_supplicant AP mode startup
to try to update Beacon IEs before the AP mode was properly initialized
and that resulted in NULL pointer dereference in driver_nl80211.c. Fix
this by skipping the IE update before the AP mode is initialized.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/ap.c

index a3b460ec405bc65aca645806510bb656284e0b22..2d147d1a4013b0350640d38e6af9be61022d183f 100644 (file)
@@ -913,7 +913,9 @@ int wpa_supplicant_ap_update_beacon(struct wpa_supplicant *wpa_s)
        struct wpa_ssid *ssid = wpa_s->current_ssid;
        struct hostapd_data *hapd;
 
-       if (ssid == NULL || wpa_s->ap_iface == NULL)
+       if (ssid == NULL || wpa_s->ap_iface == NULL ||
+           ssid->mode == WPAS_MODE_INFRA ||
+           ssid->mode == WPAS_MODE_IBSS)
                return -1;
 
 #ifdef CONFIG_P2P
@@ -924,8 +926,10 @@ int wpa_supplicant_ap_update_beacon(struct wpa_supplicant *wpa_s)
                        P2P_GROUP_FORMATION;
 #endif /* CONFIG_P2P */
 
-       ieee802_11_set_beacons(iface);
        hapd = iface->bss[0];
+       if (hapd->drv_priv == NULL)
+               return -1;
+       ieee802_11_set_beacons(iface);
        hostapd_set_ap_wps_ie(hapd);
 
        return 0;