From 4424aa5d7d1a1624b2a2e0241430da7ee3e80a54 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 20 Sep 2016 18:00:22 +0300 Subject: [PATCH] P2P: Fix D-Bus persistent parameter in group started event on GO When starting a P2P GO, the struct p2p_go_neg_results may use persistent_group == 2 to indicate use of persistent reconnect. Setting ssid->p2p_persistent_group based on this did not take into account this special case and that ended up in D-Bus code trying to encode 2 as a DBUS_TYPE_BOOLEAN value which results in an assert from the library. Fix this by setting ssid->p2p_persistent_group to 0 or 1 instead of raw params->persistent_group value without any filtering. This is similar to an earlier fix in commit 112fdee738d28c4e8bfb66ad7202d4348c4e7771 ('P2P: Fix D-Bus persistent parameter in group started event') that addressed another code path in sending out this D-Bus signal. Signed-off-by: Jouni Malinen --- wpa_supplicant/p2p_supplicant.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 31eeb38..b89d43e 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -1881,7 +1881,7 @@ static void wpas_start_wps_go(struct wpa_supplicant *wpa_s, wpa_config_set_network_defaults(ssid); ssid->temporary = 1; ssid->p2p_group = 1; - ssid->p2p_persistent_group = params->persistent_group; + ssid->p2p_persistent_group = !!params->persistent_group; ssid->mode = group_formation ? WPAS_MODE_P2P_GROUP_FORMATION : WPAS_MODE_P2P_GO; ssid->frequency = params->freq; -- 2.1.4