Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

am 68b591f: am c7da28c: Set interface down in case of "driver stop" c…

…ommand (b/2271658)

Merge commit '68b591fa9047f2df4ac6b346e10e4879f84e95ee' into eclair-mr2-plus-aosp

* commit '68b591fa9047f2df4ac6b346e10e4879f84e95ee':
  Set interface down in case of "driver stop" command (b/2271658)
  • Loading branch information...
commit 78eb90b055f8880139e4c690715051517a7c33a9 2 parents cce8160 + 68b591f
Dmitry Shmidt authored Android Git Automerger committed
Showing with 11 additions and 2 deletions.
  1. +11 −2 driver_wext.c
View
13 driver_wext.c
@@ -2520,12 +2520,12 @@ static char *wpa_driver_get_country_code(int channels)
return country;
}
-static int wpa_driver_priv_driver_cmd( void *priv, char *cmd, char *buf, size_t buf_len )
+static int wpa_driver_priv_driver_cmd(void *priv, char *cmd, char *buf, size_t buf_len)
{
struct wpa_driver_wext_data *drv = priv;
struct wpa_supplicant *wpa_s = (struct wpa_supplicant *)(drv->ctx);
struct iwreq iwr;
- int ret = 0;
+ int ret = 0, flags;
wpa_printf(MSG_DEBUG, "%s %s len = %d", __func__, cmd, buf_len);
@@ -2539,6 +2539,15 @@ static int wpa_driver_priv_driver_cmd( void *priv, char *cmd, char *buf, size_t
os_snprintf(cmd, MAX_DRV_CMD_SIZE, "COUNTRY %s",
wpa_driver_get_country_code(no_of_chan));
}
+ else if (os_strcasecmp(cmd, "STOP") == 0) {
+ if ((wpa_driver_wext_get_ifflags(drv, &flags) == 0) &&
+ (flags & IFF_UP)) {
+ wpa_printf(MSG_ERROR, "WEXT: %s when iface is UP",
+ cmd);
+ wpa_driver_wext_set_ifflags(drv, flags & ~IFF_UP);
+ }
+ }
+
os_memset(&iwr, 0, sizeof(iwr));
os_strncpy(iwr.ifr_name, drv->ifname, IFNAMSIZ);
os_memcpy(buf, cmd, strlen(cmd) + 1);
Please sign in to comment.
Something went wrong with that request. Please try again.