]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2PS: Save intended interface address after P2PS PD
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Thu, 2 Jul 2015 07:45:08 +0000 (10:45 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 7 Jul 2015 17:59:44 +0000 (20:59 +0300)
One possible outcome of the P2PS PD is P2P GO/P2P Client. In this case,
one peer becomes a P2P GO and the P2P Client joins it. Since multiple
GOs may run simultaneously on the same P2P Device, the P2P Client should
join using the intended interface address.

To be able to find the device by the intended interface address, save it
during the PD.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Max Stepanov <Max.Stepanov@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
src/p2p/p2p_i.h
src/p2p/p2p_pd.c

index a1042d2304fb9a40e0eac54ff4627e557e7927d7..f4b24058b6286f82fa6fd6bd1bf930c7439aed90 100644 (file)
@@ -53,6 +53,9 @@ struct p2p_device {
         * from Beacon/Probe Response), the interface address is stored here.
         * p2p_device_addr must still be set in such a case to the unique
         * identifier for the P2P Device.
+        *
+        * This field is also used during P2PS PD to store the intended GO
+        * address of the peer.
         */
        u8 interface_addr[ETH_ALEN];
 
index 1342231982e091412faa8d247a6d32521836541d..5366d8db775a97c41bd8af3059e1955bfed4a9e8 100644 (file)
@@ -821,6 +821,10 @@ out:
                                dev->wps_prov_info = 0;
                                break;
                        }
+
+                       if (msg.intended_addr)
+                               os_memcpy(dev->interface_addr,
+                                         msg.intended_addr, ETH_ALEN);
                }
        }
        p2p_parse_free(&msg);
@@ -1120,6 +1124,8 @@ void p2p_process_prov_disc_resp(struct p2p_data *p2p, const u8 *sa,
 
        /* Store the provisioning info */
        dev->wps_prov_info = msg.wps_config_methods;
+       if (msg.intended_addr)
+               os_memcpy(dev->interface_addr, msg.intended_addr, ETH_ALEN);
 
        p2p_parse_free(&msg);
        success = 1;