2 * Wi-Fi Direct - P2P group operations
3 * Copyright (c) 2009-2010, Atheros Communications
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
12 #include "common/ieee802_11_defs.h"
13 #include "common/ieee802_11_common.h"
14 #include "wps/wps_defs.h"
15 #include "wps/wps_i.h"
20 struct p2p_group_member {
21 struct p2p_group_member *next;
22 u8 addr[ETH_ALEN]; /* P2P Interface Address */
23 u8 dev_addr[ETH_ALEN]; /* P2P Device Address */
24 struct wpabuf *p2p_ie;
25 struct wpabuf *wfd_ie;
26 struct wpabuf *client_info;
31 * struct p2p_group - Internal P2P module per-group data
35 struct p2p_group_config *cfg;
36 struct p2p_group_member *members;
37 unsigned int num_members;
41 struct wpabuf *wfd_ie;
45 struct p2p_group * p2p_group_init(struct p2p_data *p2p,
46 struct p2p_group_config *config)
48 struct p2p_group *group, **groups;
50 group = os_zalloc(sizeof(*group));
54 groups = os_realloc_array(p2p->groups, p2p->num_groups + 1,
55 sizeof(struct p2p_group *));
60 groups[p2p->num_groups++] = group;
65 group->group_formation = 1;
66 group->beacon_update = 1;
67 p2p_group_update_ies(group);
68 group->cfg->idle_update(group->cfg->cb_ctx, 1);
74 static void p2p_group_free_member(struct p2p_group_member *m)
76 wpabuf_free(m->wfd_ie);
77 wpabuf_free(m->p2p_ie);
78 wpabuf_free(m->client_info);
83 static void p2p_group_free_members(struct p2p_group *group)
85 struct p2p_group_member *m, *prev;
87 group->members = NULL;
88 group->num_members = 0;
92 p2p_group_free_member(prev);
97 void p2p_group_deinit(struct p2p_group *group)
100 struct p2p_data *p2p;
107 for (g = 0; g < p2p->num_groups; g++) {
108 if (p2p->groups[g] == group) {
109 while (g + 1 < p2p->num_groups) {
110 p2p->groups[g] = p2p->groups[g + 1];
118 p2p_group_free_members(group);
120 wpabuf_free(group->noa);
121 wpabuf_free(group->wfd_ie);
126 static void p2p_client_info(struct wpabuf *ie, struct p2p_group_member *m)
128 if (m->client_info == NULL)
130 if (wpabuf_tailroom(ie) < wpabuf_len(m->client_info) + 1)
132 wpabuf_put_buf(ie, m->client_info);
136 static void p2p_group_add_common_ies(struct p2p_group *group,
139 u8 dev_capab = group->p2p->dev_capab, group_capab = 0;
142 dev_capab &= ~P2P_DEV_CAPAB_CLIENT_DISCOVERABILITY;
143 group_capab |= P2P_GROUP_CAPAB_GROUP_OWNER;
144 if (group->cfg->persistent_group) {
145 group_capab |= P2P_GROUP_CAPAB_PERSISTENT_GROUP;
146 if (group->cfg->persistent_group == 2)
147 group_capab |= P2P_GROUP_CAPAB_PERSISTENT_RECONN;
149 if (group->p2p->cfg->p2p_intra_bss)
150 group_capab |= P2P_GROUP_CAPAB_INTRA_BSS_DIST;
151 if (group->group_formation)
152 group_capab |= P2P_GROUP_CAPAB_GROUP_FORMATION;
153 if (group->p2p->cross_connect)
154 group_capab |= P2P_GROUP_CAPAB_CROSS_CONN;
155 if (group->num_members >= group->cfg->max_clients)
156 group_capab |= P2P_GROUP_CAPAB_GROUP_LIMIT;
157 p2p_buf_add_capability(ie, dev_capab, group_capab);
161 static void p2p_group_add_noa(struct wpabuf *ie, struct wpabuf *noa)
165 /* Notice of Absence */
166 wpabuf_put_u8(ie, P2P_ATTR_NOTICE_OF_ABSENCE);
167 wpabuf_put_le16(ie, wpabuf_len(noa));
168 wpabuf_put_buf(ie, noa);
172 static struct wpabuf * p2p_group_build_beacon_ie(struct p2p_group *group)
178 #ifdef CONFIG_WIFI_DISPLAY
179 if (group->p2p->wfd_ie_beacon)
180 extra = wpabuf_len(group->p2p->wfd_ie_beacon);
181 #endif /* CONFIG_WIFI_DISPLAY */
183 ie = wpabuf_alloc(257 + extra);
187 #ifdef CONFIG_WIFI_DISPLAY
188 if (group->p2p->wfd_ie_beacon)
189 wpabuf_put_buf(ie, group->p2p->wfd_ie_beacon);
190 #endif /* CONFIG_WIFI_DISPLAY */
192 len = p2p_buf_add_ie_hdr(ie);
193 p2p_group_add_common_ies(group, ie);
194 p2p_buf_add_device_id(ie, group->p2p->cfg->dev_addr);
195 p2p_group_add_noa(ie, group->noa);
196 p2p_buf_update_ie_hdr(ie, len);
202 #ifdef CONFIG_WIFI_DISPLAY
204 struct wpabuf * p2p_group_get_wfd_ie(struct p2p_group *g)
210 struct wpabuf * wifi_display_encaps(struct wpabuf *subelems)
215 if (subelems == NULL)
218 ie = wpabuf_alloc(wpabuf_len(subelems) + 100);
222 pos = wpabuf_head(subelems);
223 end = pos + wpabuf_len(subelems);
226 size_t frag_len = end - pos;
229 wpabuf_put_u8(ie, WLAN_EID_VENDOR_SPECIFIC);
230 wpabuf_put_u8(ie, 4 + frag_len);
231 wpabuf_put_be32(ie, WFD_IE_VENDOR_TYPE);
232 wpabuf_put_data(ie, pos, frag_len);
240 static int wifi_display_add_dev_info_descr(struct wpabuf *buf,
241 struct p2p_group_member *m)
244 const u8 *dev_info = NULL;
245 const u8 *assoc_bssid = NULL;
246 const u8 *coupled_sink = NULL;
247 u8 zero_addr[ETH_ALEN];
249 if (m->wfd_ie == NULL)
252 os_memset(zero_addr, 0, ETH_ALEN);
253 pos = wpabuf_head_u8(m->wfd_ie);
254 end = pos + wpabuf_len(m->wfd_ie);
255 while (pos + 1 < end) {
260 len = WPA_GET_BE16(pos);
266 case WFD_SUBELEM_DEVICE_INFO:
271 case WFD_SUBELEM_ASSOCIATED_BSSID:
276 case WFD_SUBELEM_COUPLED_SINK:
277 if (len < 1 + ETH_ALEN)
286 if (dev_info == NULL)
289 wpabuf_put_u8(buf, 23);
290 wpabuf_put_data(buf, m->dev_addr, ETH_ALEN);
292 wpabuf_put_data(buf, assoc_bssid, ETH_ALEN);
294 wpabuf_put_data(buf, zero_addr, ETH_ALEN);
295 wpabuf_put_data(buf, dev_info, 2); /* WFD Device Info */
296 wpabuf_put_data(buf, dev_info + 4, 2); /* WFD Device Max Throughput */
298 wpabuf_put_data(buf, coupled_sink, 1 + ETH_ALEN);
300 wpabuf_put_u8(buf, 0);
301 wpabuf_put_data(buf, zero_addr, ETH_ALEN);
308 static struct wpabuf *
309 wifi_display_build_go_ie(struct p2p_group *group)
311 struct wpabuf *wfd_subelems, *wfd_ie;
312 struct p2p_group_member *m;
314 unsigned int count = 0;
316 if (!group->p2p->wfd_ie_probe_resp)
319 wfd_subelems = wpabuf_alloc(wpabuf_len(group->p2p->wfd_ie_probe_resp) +
320 group->num_members * 24 + 100);
321 if (wfd_subelems == NULL)
323 if (group->p2p->wfd_dev_info)
324 wpabuf_put_buf(wfd_subelems, group->p2p->wfd_dev_info);
325 if (group->p2p->wfd_assoc_bssid)
326 wpabuf_put_buf(wfd_subelems,
327 group->p2p->wfd_assoc_bssid);
328 if (group->p2p->wfd_coupled_sink_info)
329 wpabuf_put_buf(wfd_subelems,
330 group->p2p->wfd_coupled_sink_info);
332 /* Build WFD Session Info */
333 wpabuf_put_u8(wfd_subelems, WFD_SUBELEM_SESSION_INFO);
334 len = wpabuf_put(wfd_subelems, 2);
337 if (wifi_display_add_dev_info_descr(wfd_subelems, m))
343 /* No Wi-Fi Display clients - do not include subelement */
344 wfd_subelems->used -= 3;
346 WPA_PUT_BE16(len, (u8 *) wpabuf_put(wfd_subelems, 0) - len -
348 wpa_printf(MSG_DEBUG, "WFD: WFD Session Info: %u descriptors",
352 wfd_ie = wifi_display_encaps(wfd_subelems);
353 wpabuf_free(wfd_subelems);
358 static void wifi_display_group_update(struct p2p_group *group)
360 wpabuf_free(group->wfd_ie);
361 group->wfd_ie = wifi_display_build_go_ie(group);
364 #endif /* CONFIG_WIFI_DISPLAY */
367 static struct wpabuf * p2p_group_build_probe_resp_ie(struct p2p_group *group)
371 struct p2p_group_member *m;
375 #ifdef CONFIG_WIFI_DISPLAY
377 extra += wpabuf_len(group->wfd_ie);
378 #endif /* CONFIG_WIFI_DISPLAY */
380 ie = wpabuf_alloc(257 + extra);
384 #ifdef CONFIG_WIFI_DISPLAY
386 wpabuf_put_buf(ie, group->wfd_ie);
387 #endif /* CONFIG_WIFI_DISPLAY */
389 len = p2p_buf_add_ie_hdr(ie);
391 p2p_group_add_common_ies(group, ie);
392 p2p_group_add_noa(ie, group->noa);
394 /* P2P Device Info */
395 p2p_buf_add_device_info(ie, group->p2p, NULL);
398 group_info = wpabuf_put(ie, 0);
399 wpabuf_put_u8(ie, P2P_ATTR_GROUP_INFO);
400 wpabuf_put_le16(ie, 0); /* Length to be filled */
401 for (m = group->members; m; m = m->next)
402 p2p_client_info(ie, m);
403 WPA_PUT_LE16(group_info + 1,
404 (u8 *) wpabuf_put(ie, 0) - group_info - 3);
406 p2p_buf_update_ie_hdr(ie, len);
412 void p2p_group_update_ies(struct p2p_group *group)
414 struct wpabuf *beacon_ie;
415 struct wpabuf *probe_resp_ie;
417 #ifdef CONFIG_WIFI_DISPLAY
418 wifi_display_group_update(group);
419 #endif /* CONFIG_WIFI_DISPLAY */
421 probe_resp_ie = p2p_group_build_probe_resp_ie(group);
422 if (probe_resp_ie == NULL)
424 wpa_hexdump_buf(MSG_MSGDUMP, "P2P: Update GO Probe Response P2P IE",
427 if (group->beacon_update) {
428 beacon_ie = p2p_group_build_beacon_ie(group);
430 group->beacon_update = 0;
431 wpa_hexdump_buf(MSG_MSGDUMP, "P2P: Update GO Beacon P2P IE",
436 group->cfg->ie_update(group->cfg->cb_ctx, beacon_ie, probe_resp_ie);
441 * p2p_build_client_info - Build P2P Client Info Descriptor
442 * @addr: MAC address of the peer device
443 * @p2p_ie: P2P IE from (Re)Association Request
444 * @dev_capab: Buffer for returning Device Capability
445 * @dev_addr: Buffer for returning P2P Device Address
446 * Returns: P2P Client Info Descriptor or %NULL on failure
448 * This function builds P2P Client Info Descriptor based on the information
449 * available from (Re)Association Request frame. Group owner can use this to
450 * build the P2P Group Info attribute for Probe Response frames.
452 static struct wpabuf * p2p_build_client_info(const u8 *addr,
453 struct wpabuf *p2p_ie,
454 u8 *dev_capab, u8 *dev_addr)
457 struct p2p_message msg;
464 os_memset(&msg, 0, sizeof(msg));
465 if (p2p_parse_p2p_ie(p2p_ie, &msg) ||
466 msg.capability == NULL || msg.p2p_device_info == NULL)
469 buf = wpabuf_alloc(ETH_ALEN + 1 + 1 + msg.p2p_device_info_len);
473 *dev_capab = msg.capability[0];
474 os_memcpy(dev_addr, msg.p2p_device_addr, ETH_ALEN);
476 spos = msg.p2p_device_info; /* P2P Device address */
478 /* P2P Client Info Descriptor */
479 /* Length to be set */
480 len_pos = wpabuf_put(buf, 1);
481 /* P2P Device address */
482 wpabuf_put_data(buf, spos, ETH_ALEN);
483 /* P2P Interface address */
484 wpabuf_put_data(buf, addr, ETH_ALEN);
485 /* Device Capability Bitmap */
486 wpabuf_put_u8(buf, msg.capability[0]);
488 * Config Methods, Primary Device Type, Number of Secondary Device
489 * Types, Secondary Device Type List, Device Name copied from
492 wpabuf_put_data(buf, spos + ETH_ALEN,
493 msg.p2p_device_info_len - ETH_ALEN);
495 *len_pos = wpabuf_len(buf) - 1;
502 static int p2p_group_remove_member(struct p2p_group *group, const u8 *addr)
504 struct p2p_group_member *m, *prev;
512 if (os_memcmp(m->addr, addr, ETH_ALEN) == 0)
522 prev->next = m->next;
524 group->members = m->next;
525 p2p_group_free_member(m);
526 group->num_members--;
532 int p2p_group_notif_assoc(struct p2p_group *group, const u8 *addr,
533 const u8 *ie, size_t len)
535 struct p2p_group_member *m;
540 m = os_zalloc(sizeof(*m));
543 os_memcpy(m->addr, addr, ETH_ALEN);
544 m->p2p_ie = ieee802_11_vendor_ie_concat(ie, len, P2P_IE_VENDOR_TYPE);
546 m->client_info = p2p_build_client_info(addr, m->p2p_ie,
550 #ifdef CONFIG_WIFI_DISPLAY
551 m->wfd_ie = ieee802_11_vendor_ie_concat(ie, len, WFD_IE_VENDOR_TYPE);
552 #endif /* CONFIG_WIFI_DISPLAY */
554 p2p_group_remove_member(group, addr);
556 m->next = group->members;
558 group->num_members++;
559 wpa_msg(group->p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Add client " MACSTR
560 " to group (p2p=%d wfd=%d client_info=%d); num_members=%u/%u",
561 MAC2STR(addr), m->p2p_ie ? 1 : 0, m->wfd_ie ? 1 : 0,
562 m->client_info ? 1 : 0,
563 group->num_members, group->cfg->max_clients);
564 if (group->num_members == group->cfg->max_clients)
565 group->beacon_update = 1;
566 p2p_group_update_ies(group);
567 if (group->num_members == 1)
568 group->cfg->idle_update(group->cfg->cb_ctx, 0);
574 struct wpabuf * p2p_group_assoc_resp_ie(struct p2p_group *group, u8 status)
580 #ifdef CONFIG_WIFI_DISPLAY
582 extra = wpabuf_len(group->wfd_ie);
583 #endif /* CONFIG_WIFI_DISPLAY */
586 * (Re)Association Response - P2P IE
587 * Status attribute (shall be present when association request is
589 * Extended Listen Timing (may be present)
591 resp = wpabuf_alloc(20 + extra);
595 #ifdef CONFIG_WIFI_DISPLAY
597 wpabuf_put_buf(resp, group->wfd_ie);
598 #endif /* CONFIG_WIFI_DISPLAY */
600 rlen = p2p_buf_add_ie_hdr(resp);
601 if (status != P2P_SC_SUCCESS)
602 p2p_buf_add_status(resp, status);
603 p2p_buf_update_ie_hdr(resp, rlen);
609 void p2p_group_notif_disassoc(struct p2p_group *group, const u8 *addr)
611 if (p2p_group_remove_member(group, addr)) {
612 wpa_msg(group->p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Remove "
613 "client " MACSTR " from group; num_members=%u/%u",
614 MAC2STR(addr), group->num_members,
615 group->cfg->max_clients);
616 if (group->num_members == group->cfg->max_clients - 1)
617 group->beacon_update = 1;
618 p2p_group_update_ies(group);
619 if (group->num_members == 0)
620 group->cfg->idle_update(group->cfg->cb_ctx, 1);
626 * p2p_match_dev_type_member - Match client device type with requested type
628 * @wps: WPS TLVs from Probe Request frame (concatenated WPS IEs)
629 * Returns: 1 on match, 0 on mismatch
631 * This function can be used to match the Requested Device Type attribute in
632 * WPS IE with the device types of a group member for deciding whether a GO
633 * should reply to a Probe Request frame.
635 static int p2p_match_dev_type_member(struct p2p_group_member *m,
639 struct wps_parse_attr attr;
642 if (m->client_info == NULL || wps == NULL)
645 pos = wpabuf_head(m->client_info);
646 end = pos + wpabuf_len(m->client_info);
648 pos += 1 + 2 * ETH_ALEN + 1 + 2;
649 if (end - pos < WPS_DEV_TYPE_LEN + 1)
652 if (wps_parse_msg(wps, &attr))
653 return 1; /* assume no Requested Device Type attributes */
655 if (attr.num_req_dev_type == 0)
656 return 1; /* no Requested Device Type attributes -> match */
658 if (dev_type_list_match(pos, attr.req_dev_type, attr.num_req_dev_type))
659 return 1; /* Match with client Primary Device Type */
661 pos += WPS_DEV_TYPE_LEN;
663 if (end - pos < num_sec * WPS_DEV_TYPE_LEN)
665 while (num_sec > 0) {
667 if (dev_type_list_match(pos, attr.req_dev_type,
668 attr.num_req_dev_type))
669 return 1; /* Match with client Secondary Device Type */
670 pos += WPS_DEV_TYPE_LEN;
673 /* No matching device type found */
678 int p2p_group_match_dev_type(struct p2p_group *group, struct wpabuf *wps)
680 struct p2p_group_member *m;
682 if (p2p_match_dev_type(group->p2p, wps))
683 return 1; /* Match with own device type */
685 for (m = group->members; m; m = m->next) {
686 if (p2p_match_dev_type_member(m, wps))
687 return 1; /* Match with group client device type */
690 /* No match with Requested Device Type */
695 int p2p_group_match_dev_id(struct p2p_group *group, struct wpabuf *p2p)
697 struct p2p_group_member *m;
698 struct p2p_message msg;
700 os_memset(&msg, 0, sizeof(msg));
701 if (p2p_parse_p2p_ie(p2p, &msg))
702 return 1; /* Failed to parse - assume no filter on Device ID */
705 return 1; /* No filter on Device ID */
707 if (os_memcmp(msg.device_id, group->p2p->cfg->dev_addr, ETH_ALEN) == 0)
708 return 1; /* Match with our P2P Device Address */
710 for (m = group->members; m; m = m->next) {
711 if (os_memcmp(msg.device_id, m->dev_addr, ETH_ALEN) == 0)
712 return 1; /* Match with group client P2P Device Address */
715 /* No match with Device ID */
720 void p2p_group_notif_formation_done(struct p2p_group *group)
724 group->group_formation = 0;
725 group->beacon_update = 1;
726 p2p_group_update_ies(group);
730 int p2p_group_notif_noa(struct p2p_group *group, const u8 *noa,
734 wpabuf_free(group->noa);
738 if (wpabuf_size(group->noa) >= noa_len) {
739 group->noa->used = 0;
740 wpabuf_put_data(group->noa, noa, noa_len);
742 wpabuf_free(group->noa);
748 group->noa = wpabuf_alloc_copy(noa, noa_len);
749 if (group->noa == NULL)
754 group->beacon_update = 1;
755 p2p_group_update_ies(group);
760 static struct p2p_group_member * p2p_group_get_client(struct p2p_group *group,
763 struct p2p_group_member *m;
765 for (m = group->members; m; m = m->next) {
766 if (os_memcmp(dev_id, m->dev_addr, ETH_ALEN) == 0)
774 static struct p2p_group_member * p2p_group_get_client_iface(
775 struct p2p_group *group, const u8 *interface_addr)
777 struct p2p_group_member *m;
779 for (m = group->members; m; m = m->next) {
780 if (os_memcmp(interface_addr, m->addr, ETH_ALEN) == 0)
788 const u8 * p2p_group_get_dev_addr(struct p2p_group *group, const u8 *addr)
790 struct p2p_group_member *m;
794 m = p2p_group_get_client_iface(group, addr);
795 if (m && !is_zero_ether_addr(m->dev_addr))
801 static struct wpabuf * p2p_build_go_disc_req(void)
805 buf = wpabuf_alloc(100);
809 p2p_buf_add_action_hdr(buf, P2P_GO_DISC_REQ, 0);
815 int p2p_group_go_discover(struct p2p_group *group, const u8 *dev_id,
816 const u8 *searching_dev, int rx_freq)
818 struct p2p_group_member *m;
820 struct p2p_data *p2p = group->p2p;
823 m = p2p_group_get_client(group, dev_id);
824 if (m == NULL || m->client_info == NULL) {
825 wpa_printf(MSG_DEBUG, "P2P: Requested client was not in this "
827 MAC2STR(group->cfg->interface_addr));
831 if (!(m->dev_capab & P2P_DEV_CAPAB_CLIENT_DISCOVERABILITY)) {
832 wpa_printf(MSG_DEBUG, "P2P: Requested client does not support "
833 "client discoverability");
837 wpa_printf(MSG_DEBUG, "P2P: Schedule GO Discoverability Request to be "
838 "sent to " MACSTR, MAC2STR(dev_id));
840 req = p2p_build_go_disc_req();
844 /* TODO: Should really use group operating frequency here */
847 p2p->pending_action_state = P2P_PENDING_GO_DISC_REQ;
848 if (p2p->cfg->send_action(p2p->cfg->cb_ctx, freq, m->addr,
849 group->cfg->interface_addr,
850 group->cfg->interface_addr,
851 wpabuf_head(req), wpabuf_len(req), 200) < 0)
853 wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
854 "P2P: Failed to send Action frame");
863 const u8 * p2p_group_get_interface_addr(struct p2p_group *group)
865 return group->cfg->interface_addr;
869 u8 p2p_group_presence_req(struct p2p_group *group,
870 const u8 *client_interface_addr,
871 const u8 *noa, size_t noa_len)
873 struct p2p_group_member *m;
877 m = p2p_group_get_client_iface(group, client_interface_addr);
878 if (m == NULL || m->client_info == NULL) {
879 wpa_printf(MSG_DEBUG, "P2P: Client was not in this group");
880 return P2P_SC_FAIL_UNABLE_TO_ACCOMMODATE;
883 wpa_hexdump(MSG_DEBUG, "P2P: Presence Request NoA", noa, noa_len);
885 if (group->p2p->cfg->get_noa)
886 curr_noa_len = group->p2p->cfg->get_noa(
887 group->p2p->cfg->cb_ctx, group->cfg->interface_addr,
888 curr_noa, sizeof(curr_noa));
891 if (curr_noa_len < 0)
892 wpa_printf(MSG_DEBUG, "P2P: Failed to fetch current NoA");
893 else if (curr_noa_len == 0)
894 wpa_printf(MSG_DEBUG, "P2P: No NoA being advertized");
896 wpa_hexdump(MSG_DEBUG, "P2P: Current NoA", curr_noa,
899 /* TODO: properly process request and store copy */
900 if (curr_noa_len > 0 || curr_noa_len == -1)
901 return P2P_SC_FAIL_UNABLE_TO_ACCOMMODATE;
903 return P2P_SC_SUCCESS;
907 unsigned int p2p_get_group_num_members(struct p2p_group *group)
909 return group->num_members;
913 const u8 * p2p_iterate_group_members(struct p2p_group *group, void **next)
915 struct p2p_group_member *iter = *next;
918 iter = group->members;
931 int p2p_group_is_client_connected(struct p2p_group *group, const u8 *dev_addr)
933 struct p2p_group_member *m;
935 for (m = group->members; m; m = m->next) {
936 if (os_memcmp(m->dev_addr, dev_addr, ETH_ALEN) == 0)
944 int p2p_group_is_group_id_match(struct p2p_group *group, const u8 *group_id,
947 if (group_id_len != ETH_ALEN + group->cfg->ssid_len)
949 if (os_memcmp(group_id, group->p2p->cfg->dev_addr, ETH_ALEN) != 0)
951 return os_memcmp(group_id + ETH_ALEN, group->cfg->ssid,
952 group->cfg->ssid_len) == 0;