]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Fix TDLS and l2_packet init without P2P Device interface
authorJouni Malinen <j@w1.fi>
Sun, 30 Jun 2013 17:02:25 +0000 (20:02 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 30 Jun 2013 17:02:25 +0000 (20:02 +0300)
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 <j@w1.fi>

wpa_supplicant/wpa_supplicant.c

index ff96668a5415be91c0d468191c15e9fbe41ab2ed..e23b5c644e0a4a02e5634e104de82cf8b57b1ab1 100644 (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 */