]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Cleanup AP callbacks when removing the group
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>
Wed, 12 Oct 2011 18:06:39 +0000 (21:06 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 12 Oct 2011 18:06:39 +0000 (21:06 +0300)
Clear the P2P GO callback parameters when removing the group to avoid
using these for non-P2P AP mode.

This is a fix for the bug I found in the following scenario:

A) p2p_group_add
A) p2p_group_remove wlan0
A) add_n
A) set_n 0 ssid "testap"
A) set_n 0 key_mgmt NONE
A) set_n 0 mode 2
A) set_n 0 frequency 2412
A) enable_n 0

B) try connect to testap

Authentication request will be always rejected because of
HOSTAPD_ACL_REJECT and not cleaned callbacks when group removed.

wpa_supplicant/p2p_supplicant.c

index 92bfc41dbaeffab5ac4c828fcb056daa7b8cd3ff..9af1839f16b0fc4280e604f02affc11446c1e1d3 100644 (file)
@@ -3489,6 +3489,11 @@ void wpas_p2p_group_deinit(struct wpa_supplicant *wpa_s)
 {
        p2p_group_deinit(wpa_s->p2p_group);
        wpa_s->p2p_group = NULL;
+
+       wpa_s->ap_configured_cb = NULL;
+       wpa_s->ap_configured_cb_ctx = NULL;
+       wpa_s->ap_configured_cb_data = NULL;
+       wpa_s->connect_without_scan = NULL;
 }