]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WFD: Properly match group for WFD element in Invitation Response
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 5 Sep 2012 13:39:19 +0000 (16:39 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 5 Sep 2012 13:39:19 +0000 (16:39 +0300)
The group matching should be done by comparing the P2P Interface Address
(which the group_bssid here is) to the group's BSSID and not the group
ID (which uses P2P Device Address and would have also needed the SSID).
Though, it should be noted that this case cannot really happen since a
GO in an active group would never be invited to join another group in
its GO role (i.e., if it receives an Invitation Request, it will reply
in P2P Device role). As such, this fix does not really change any
observable behavior, but anyway, it is good to keep the implementation
here consistent with the Invitation Request case.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/p2p/p2p_invitation.c

index 4745c0fa3901e17a29893ae0fae15fe0e77fbefe..d26654b6619f8c815da20af7bf35f8779371dc28 100644 (file)
@@ -104,8 +104,8 @@ static struct wpabuf * p2p_build_invitation_resp(struct p2p_data *p2p,
                for (i = 0; i < p2p->num_groups; i++) {
                        struct p2p_group *g = p2p->groups[i];
                        struct wpabuf *ie;
-                       if (!p2p_group_is_group_id_match(g, group_bssid,
-                                                        ETH_ALEN))
+                       if (os_memcmp(p2p_group_get_interface_addr(g),
+                                     group_bssid, ETH_ALEN) != 0)
                                continue;
                        ie = p2p_group_get_wfd_ie(g);
                        if (ie) {