From a05126d6200377f19aa5517318b124a1d9cfbbd0 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 5 Sep 2012 16:39:19 +0300 Subject: [PATCH] WFD: Properly match group for WFD element in Invitation Response 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 --- src/p2p/p2p_invitation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p2p/p2p_invitation.c b/src/p2p/p2p_invitation.c index 4745c0fa3..d26654b66 100644 --- a/src/p2p/p2p_invitation.c +++ b/src/p2p/p2p_invitation.c @@ -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) {