P2P: Add a separate pointer to the P2P Device instance
authorLior David <qca_liord@qca.qualcomm.com>
Sun, 24 Jan 2016 15:36:49 +0000 (17:36 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 27 Feb 2016 17:37:19 +0000 (19:37 +0200)
commitba307f8528b1242c931a57feb21cd30286126916
tree9d937c5b64b80849c935660908c178845846687f
parente04019737e9987137bec9034f2f9684c70275cd3
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>
wpa_supplicant/ap.c
wpa_supplicant/dbus/dbus_new.c
wpa_supplicant/p2p_supplicant.c
wpa_supplicant/sme.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h
wpa_supplicant/wps_supplicant.c