From 438be60153dbfe3e3da9d53edb5e7b1b1dac7567 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 30 Dec 2015 19:06:19 +0200 Subject: [PATCH] P2P: Do not accept any GO BSS entry if SSID is specified for join Accept only a BSS entry matching the SSID when trying to find the operating channel of a GO during join operation for which the SSID was already specified. Previously, it could have been possible to pick an incorrect BSS entry if the new GO was not found in the latest scan and there was an older cached scan entry for the same BSSID. Signed-off-by: Jouni Malinen --- wpa_supplicant/p2p_supplicant.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index a456d3edb..16c196297 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -4825,8 +4825,7 @@ static void wpas_p2p_scan_res_join(struct wpa_supplicant *wpa_s, bss = wpa_bss_get(wpa_s, wpa_s->pending_join_iface_addr, wpa_s->p2p_join_ssid, wpa_s->p2p_join_ssid_len); - } - if (!bss) { + } else if (!bss) { wpa_printf(MSG_DEBUG, "P2P: Trying to find target GO BSS entry based on BSSID " MACSTR, MAC2STR(wpa_s->pending_join_iface_addr)); bss = wpa_bss_get_bssid_latest(wpa_s,