aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEyal Shapira <eyal@wizery.com>2012-07-22 02:57:08 +0300
committerArik Nemtsov <arik@wizery.com>2012-08-02 13:04:02 +0300
commit81c54f11a0026a8f08668e0d6c6f75f24cd4f5c8 (patch)
tree10b5d0e8937afe409bb282e638fbe9acc89a6f74
parent229bb110ab53bebd947b505e519d33d72f15442b (diff)
downloadexternal_wpa_supplicant_8_ti-81c54f11a0026a8f08668e0d6c6f75f24cd4f5c8.zip
external_wpa_supplicant_8_ti-81c54f11a0026a8f08668e0d6c6f75f24cd4f5c8.tar.gz
external_wpa_supplicant_8_ti-81c54f11a0026a8f08668e0d6c6f75f24cd4f5c8.tar.bz2
Handle new interface parameter in ctrl commands (BRCM)
Some commands sent to wpa_s by the framework in JB include a new interface parameter. Handle it and dispatch the the command on the correct interface. Signed-off-by: Eyal Shapira <eyal@wizery.com>
-rw-r--r--wpa_supplicant/ctrl_iface_unix.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/wpa_supplicant/ctrl_iface_unix.c b/wpa_supplicant/ctrl_iface_unix.c
index b9620e0..d982c1f 100644
--- a/wpa_supplicant/ctrl_iface_unix.c
+++ b/wpa_supplicant/ctrl_iface_unix.c
@@ -164,6 +164,35 @@ static void wpa_supplicant_ctrl_iface_receive(int sock, void *eloop_ctx,
else
reply_len = 2;
} else {
+#if defined(CONFIG_P2P) && defined(ANDROID_P2P)
+ char *ifname = NULL, *arg;
+ char cmd[256];
+ /* Skip the command name */
+ arg = os_strchr(buf, ' ');
+ if (arg) {
+ *arg++ = '\0';
+ os_strncpy(cmd, buf, sizeof(cmd));
+ /* Now search for interface= */
+ if (os_strncmp(arg, "interface=", 10) == 0) {
+ ifname = arg + 10;
+ arg = os_strchr(ifname, ' ');
+ if (arg)
+ *arg++ = '\0';
+ wpa_printf(MSG_DEBUG, "Found interface= in the arg %s ifname %s", arg, ifname);
+ for (wpa_s = wpa_s->global->ifaces; wpa_s; wpa_s = wpa_s->next) {
+ if (os_strcmp(wpa_s->ifname, ifname) == 0)
+ break;
+ }
+ if (wpa_s == NULL) {
+ wpa_printf(MSG_ERROR, "P2P: interface=%s does not exist", ifname);
+ wpa_s = eloop_ctx;
+ }
+ }
+ if (arg)
+ os_snprintf(buf, sizeof(buf), "%s %s", cmd, arg);
+ }
+ wpa_printf(MSG_DEBUG, "wpa_s %p cmd %s", wpa_s, buf);
+#endif /* defined CONFIG_P2P && defined ANDROID_P2P */
reply = wpa_supplicant_ctrl_iface_process(wpa_s, buf,
&reply_len);
}