aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_supplicant.c
diff options
context:
space:
mode:
authorLior David <qca_liord@qca.qualcomm.com>2016-01-24 15:36:49 (GMT)
committerJouni Malinen <j@w1.fi>2016-02-27 17:37:19 (GMT)
commitba307f8528b1242c931a57feb21cd30286126916 (patch)
tree9d937c5b64b80849c935660908c178845846687f /wpa_supplicant/wpa_supplicant.c
parente04019737e9987137bec9034f2f9684c70275cd3 (diff)
downloadhostap-ba307f8528b1242c931a57feb21cd30286126916.zip
hostap-ba307f8528b1242c931a57feb21cd30286126916.tar.gz
hostap-ba307f8528b1242c931a57feb21cd30286126916.tar.bz2
P2P: Add a separate pointer to the P2P Device instance
In many places in the code there was a reference to wpa_s->parent to get from group interface to p2p_dev interface. These places can break if P2P_DEVICE interface would need to be used with the primary interface as the group interface, since the parent of the primary interface points to itself and not the p2p_dev interface. Fix this by adding a separate "p2pdev" pointer to wpa_supplicant, it will be the same as parent pointer in most cases but whenever the primary interface is used as a group interface, change it to point to the correct p2p_dev interface. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/wpa_supplicant.c')
-rw-r--r--wpa_supplicant/wpa_supplicant.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index dbfc34e..27c428a 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2490,8 +2490,8 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
params.p2p = ssid->p2p_group;
- if (wpa_s->parent->set_sta_uapsd)
- params.uapsd = wpa_s->parent->sta_uapsd;
+ if (wpa_s->p2pdev->set_sta_uapsd)
+ params.uapsd = wpa_s->p2pdev->sta_uapsd;
else
params.uapsd = -1;
@@ -3510,6 +3510,7 @@ wpa_supplicant_alloc(struct wpa_supplicant *parent)
wpa_s->scan_interval = 5;
wpa_s->new_connection = 1;
wpa_s->parent = parent ? parent : wpa_s;
+ wpa_s->p2pdev = wpa_s->parent;
wpa_s->sched_scanning = 0;
dl_list_init(&wpa_s->bss_tmp_disallowed);
@@ -6248,7 +6249,7 @@ wpas_vendor_elem(struct wpa_supplicant *wpa_s, enum wpa_vendor_elem_frame frame)
case VENDOR_ELEM_P2P_INV_RESP:
case VENDOR_ELEM_P2P_ASSOC_REQ:
case VENDOR_ELEM_P2P_ASSOC_RESP:
- return wpa_s->parent;
+ return wpa_s->p2pdev;
#endif /* CONFIG_P2P */
default:
return wpa_s;