u32 session_id = 0;
u8 session_mac[ETH_ALEN];
u8 adv_mac[ETH_ALEN];
- u8 group_mac[ETH_ALEN];
+ const u8 *group_mac;
int passwd_id = DEV_PW_DEFAULT;
u16 config_methods;
u16 allowed_config_methods = WPS_CONFIG_DISPLAY | WPS_CONFIG_KEYPAD;
p2p_dbg(p2p, "Received Provision Discovery Request from " MACSTR
" with config methods 0x%x (freq=%d)",
MAC2STR(sa), msg.wps_config_methods, rx_freq);
+ group_mac = msg.intended_addr;
dev = p2p_get_device(p2p, sa);
if (dev == NULL || (dev->flags & P2P_DEV_PROBE_REQ_ONLY)) {
os_memset(session_mac, 0, ETH_ALEN);
os_memset(adv_mac, 0, ETH_ALEN);
- os_memset(group_mac, 0, ETH_ALEN);
/* Note 1: A feature capability attribute structure can be changed
* in the future. The assumption is that such modifications are
req_fcap = (struct p2ps_feature_capab *) msg.feature_cap;
- if (msg.intended_addr)
- os_memcpy(group_mac, msg.intended_addr, ETH_ALEN);
-
os_memcpy(session_mac, msg.session_mac, ETH_ALEN);
os_memcpy(adv_mac, msg.adv_mac, ETH_ALEN);
u32 adv_id = 0;
u8 conncap = P2PS_SETUP_NEW;
u8 adv_mac[ETH_ALEN];
- u8 group_mac[ETH_ALEN];
+ const u8 *group_mac;
int passwd_id = DEV_PW_DEFAULT;
int p2ps_seeker;
if (msg.status)
status = *msg.status;
- if (msg.intended_addr)
- os_memcpy(group_mac, msg.intended_addr, ETH_ALEN);
- else
- os_memset(group_mac, 0, ETH_ALEN);
+ group_mac = msg.intended_addr;
if (msg.adv_mac)
os_memcpy(adv_mac, msg.adv_mac, ETH_ALEN);
persist_ssid_size);
if (persist_ssid && s && s->mode != WPAS_MODE_P2P_GO &&
- os_memcmp(grp_mac, mac, ETH_ALEN) == 0) {
+ is_zero_ether_addr(grp_mac)) {
wpa_dbg(wpa_s, MSG_ERROR,
"P2P: Peer device is a GO in a persistent group, but it did not provide the intended MAC address");
return;
wpas_p2ps_prov_complete(
wpa_s, P2P_SC_FAIL_UNKNOWN_GROUP,
dev, adv_mac, ses_mac,
- NULL, adv_id, ses_id, 0, 0,
+ grp_mac, adv_id, ses_id, 0, 0,
NULL, 0, 0, 0, NULL, NULL, 0);
return;
}