aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/ap.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2011-12-21 11:34:25 (GMT)
committerJouni Malinen <j@w1.fi>2011-12-21 11:34:25 (GMT)
commit72d48a80ec5ccdb4d3aecd7c94a0e11a4db549b4 (patch)
treeda8a1349343fd501bd24c00b8a2fe817df020bb7 /wpa_supplicant/ap.c
parentb088cf82c919a0eca7a5ea1445165f9aeb67cd5e (diff)
downloadhostap-72d48a80ec5ccdb4d3aecd7c94a0e11a4db549b4.zip
hostap-72d48a80ec5ccdb4d3aecd7c94a0e11a4db549b4.tar.gz
hostap-72d48a80ec5ccdb4d3aecd7c94a0e11a4db549b4.tar.bz2
P2P: Fix GO start on interface that has active station connection
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>
Diffstat (limited to 'wpa_supplicant/ap.c')
-rw-r--r--wpa_supplicant/ap.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index a3b460e..2d147d1 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -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;