int ht40;
id = atoi(cmd);
- pos = os_strstr(cmd, " peer=");
- if (pos) {
- pos += 6;
- if (hwaddr_aton(pos, peer))
- return -1;
- }
ssid = wpa_config_get_network(wpa_s->conf, id);
if (ssid == NULL || ssid->disabled != 2) {
wpa_printf(MSG_DEBUG, "CTRL_IFACE: Could not find SSID id=%d "
return -1;
}
+ pos = os_strstr(cmd, " peer=");
+ if (pos) {
+ pos += 6;
+ if (hwaddr_aton(pos, peer))
+ return -1;
+ }
+
ht40 = os_strstr(cmd, " ht40") != NULL;
return wpas_p2p_invite(wpa_s, pos ? peer : NULL, ssid, NULL, freq,
if (ifend != NULL)
*ifend++ = '\0';
else
- ifend = "";
+ *(ifname - 1) = '\0';
wpa_printf(MSG_DEBUG, "Found %s", ifname);
for (wpa_s = wpa_s->global->ifaces; wpa_s; wpa_s = wpa_s->next) {
if (os_strcmp(wpa_s->ifname, ifname + 10) == 0)
wpa_printf(MSG_ERROR, "P2P: %s does not exist", ifname);
wpa_s = eloop_ctx;
}
- os_memmove(ifname, ifend, strlen(ifend) + 1);
- wpa_printf(MSG_INFO, "wpa_s %p cmd %s", wpa_s, buf);
+ if (ifend != NULL)
+ os_memmove(ifname, ifend, strlen(ifend) + 1);
+ wpa_printf(MSG_INFO, "wpa_s->ifname %s cmd %s", wpa_s ? wpa_s->ifname : "NULL", buf);
}
#endif /* defined CONFIG_P2P && defined ANDROID_P2P */
reply = wpa_supplicant_ctrl_iface_process(wpa_s, buf,