]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Android: P2P: Remember country locale
authorDmitry Shmidt <dimitrysh@google.com>
Thu, 12 Sep 2013 19:39:30 +0000 (12:39 -0700)
committerJouni Malinen <j@w1.fi>
Fri, 22 Nov 2013 18:23:16 +0000 (20:23 +0200)
This updates P2P modules based on the Android specific
DRIVER COUNTRY command.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
wpa_supplicant/ctrl_iface.c

index d5a77b4ac8e3484f4f3a7d5d99a65d92a38eb913..a0604775a59eec282ec51c8b639a2b9a163231cf 100644 (file)
@@ -5165,8 +5165,19 @@ static int wpa_supplicant_driver_cmd(struct wpa_supplicant *wpa_s, char *cmd,
        int ret;
 
        ret = wpa_drv_driver_cmd(wpa_s, cmd, buf, buflen);
-       if (ret == 0)
+       if (ret == 0) {
+               if (os_strncasecmp(cmd, "COUNTRY", 7) == 0) {
+                       struct p2p_data *p2p = wpa_s->global->p2p;
+                       if (p2p) {
+                               char country[3];
+                               country[0] = cmd[8];
+                               country[1] = cmd[9];
+                               country[2] = 0x04;
+                               p2p_set_country(p2p, country);
+                       }
+               }
                ret = os_snprintf(buf, buflen, "%s\n", "OK");
+       }
        return ret;
 }
 #endif /* ANDROID */