aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-08-02 20:47:38 (GMT)
committerJouni Malinen <j@w1.fi>2016-08-02 20:47:38 (GMT)
commit112fdee738d28c4e8bfb66ad7202d4348c4e7771 (patch)
tree98597199350dcc4de70c3d58629d8b2fb8476ba0
parentcc9985d1b1a844fddbc042abe8c4f5036c0d410b (diff)
downloadhostap-112fdee738d28c4e8bfb66ad7202d4348c4e7771.zip
hostap-112fdee738d28c4e8bfb66ad7202d4348c4e7771.tar.gz
hostap-112fdee738d28c4e8bfb66ad7202d4348c4e7771.tar.bz2
P2P: Fix D-Bus persistent parameter in group started event
wpas_p2p_persistent_group() returns non-zero for persistent groups. This value happens to be 2 instead of 1 due to the P2P_GROUP_CAPAB_PERSISTENT_GROUP value. This ended up with D-Bus code trying to encode 2 as a DBUS_TYPE_BOOLEAN value which results in an assert from the library. Fix this by modifying wpas_p2p_persistent_group() to return 0 or 1 instead of 0 or an arbitrary non-zero. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--wpa_supplicant/p2p_supplicant.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index cb8df66..31eeb38 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -1076,7 +1076,7 @@ static int wpas_p2p_persistent_group(struct wpa_supplicant *wpa_s,
"go_dev_addr=" MACSTR,
MAC2STR(bssid), group_capab, MAC2STR(go_dev_addr));
- return group_capab & P2P_GROUP_CAPAB_PERSISTENT_GROUP;
+ return !!(group_capab & P2P_GROUP_CAPAB_PERSISTENT_GROUP);
}