From: Jouni Malinen Date: Sun, 30 Jun 2013 17:02:25 +0000 (+0300) Subject: P2P: Fix TDLS and l2_packet init without P2P Device interface X-Git-Tag: aosp-kk-from-upstream~148 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c42b42f6cd86fc4fc1c70c7531dc7c28b1c5646;p=thirdparty%2Fhostap.git P2P: Fix TDLS and l2_packet init without P2P Device interface Commit c68f6200a72f2b33304f583859b09e57757b9d2a made these calls conditional on !p2p_mgmt, but forced p2p_mgmt=1 for cases where the driver does not use the dedicated P2P Device. Fix this by making the !p2p_mgmt condition apply only if the driver does indicate use of a dedicated P2P Device. Signed-hostap: Jouni Malinen --- diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index ff96668a5..e23b5c644 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -2328,7 +2328,9 @@ int wpa_supplicant_update_mac_addr(struct wpa_supplicant *wpa_s) const u8 *addr = wpa_drv_get_mac_addr(wpa_s); if (addr) os_memcpy(wpa_s->own_addr, addr, ETH_ALEN); - } else if (!wpa_s->p2p_mgmt && + } else if ((!wpa_s->p2p_mgmt || + !(wpa_s->drv_flags & + WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE)) && !(wpa_s->drv_flags & WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE)) { l2_packet_deinit(wpa_s->l2); @@ -2975,7 +2977,10 @@ next_driver: return -1; #ifdef CONFIG_TDLS - if (!iface->p2p_mgmt && wpa_tdls_init(wpa_s->wpa)) + if ((!iface->p2p_mgmt || + !(wpa_s->drv_flags & + WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE)) && + wpa_tdls_init(wpa_s->wpa)) return -1; #endif /* CONFIG_TDLS */