]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Do not create another group interface on NFC Token enable
authorManish Bansal <manish.bansal@broadcom.com>
Fri, 14 Mar 2014 14:55:10 +0000 (16:55 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 14 Mar 2014 19:58:45 +0000 (21:58 +0200)
If a group interface is present and the command was issued on the group
interface, enable the token for that interface instead of creating a new
one.

Signed-off-by: Manish <manish.bansal@broadcom.com>
wpa_supplicant/p2p_supplicant.c

index 09f98a342644b9c0af8a6e2450c0bc80271a15a8..487d44d41847cea6686e4ebbc97ef286661f07df 100644 (file)
@@ -7545,7 +7545,16 @@ int wpas_p2p_nfc_tag_enabled(struct wpa_supplicant *wpa_s, int enabled)
                return -1;
        wpa_s->p2p_peer_oob_pk_hash_known = 0;
 
-       wpa_s->create_p2p_iface = wpas_p2p_create_iface(wpa_s);
+       if (wpa_s->p2p_group_interface == P2P_GROUP_INTERFACE_GO ||
+           wpa_s->p2p_group_interface == P2P_GROUP_INTERFACE_CLIENT) {
+               /*
+                * P2P Group Interface present and the command came on group
+                * interface, so enable the token for the current interface.
+                */
+               wpa_s->create_p2p_iface = 0;
+       } else {
+               wpa_s->create_p2p_iface = wpas_p2p_create_iface(wpa_s);
+       }
 
        if (wpa_s->create_p2p_iface) {
                enum wpa_driver_if_type iftype;