P2P: Fix TDLS and l2_packet init without P2P Device interface

Commit c68f6200a7 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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-06-30 20:02:25 +03:00
parent 9e6a321815
commit 1c42b42f6c

View file

@ -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 */