aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_priv.c
diff options
context:
space:
mode:
authorDaniel Mierswa <impulze@impulze.org>2009-02-15 12:13:27 (GMT)
committerJouni Malinen <j@w1.fi>2009-02-15 12:13:27 (GMT)
commit6301cc5d385ae4e3b4aa74ca863e034b8d91c326 (patch)
tree70339a728ad43a23e8b30e5dd663b572071734b3 /wpa_supplicant/wpa_priv.c
parent2cfcd014f4e2c9886af2e7433c40119091ff1535 (diff)
downloadhostap-6301cc5d385ae4e3b4aa74ca863e034b8d91c326.zip
hostap-6301cc5d385ae4e3b4aa74ca863e034b8d91c326.tar.gz
hostap-6301cc5d385ae4e3b4aa74ca863e034b8d91c326.tar.bz2
Allow the privsep driver to pass the set_country to the real driver
Diffstat (limited to 'wpa_supplicant/wpa_priv.c')
-rw-r--r--wpa_supplicant/wpa_priv.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/wpa_supplicant/wpa_priv.c b/wpa_supplicant/wpa_priv.c
index 8ad20ca..4a27125 100644
--- a/wpa_supplicant/wpa_priv.c
+++ b/wpa_supplicant/wpa_priv.c
@@ -575,10 +575,21 @@ static void wpa_priv_cmd_set_mode(struct wpa_priv_interface *iface,
}
+static void wpa_priv_cmd_set_country(struct wpa_priv_interface *iface,
+ char *buf)
+{
+ if (iface->drv_priv == NULL || iface->driver->set_country == NULL ||
+ *buf == '\0')
+ return;
+
+ iface->driver->set_country(iface->drv_priv, buf);
+}
+
+
static void wpa_priv_receive(int sock, void *eloop_ctx, void *sock_ctx)
{
struct wpa_priv_interface *iface = eloop_ctx;
- char buf[2000];
+ char buf[2000], *pos;
void *cmd_buf;
size_t cmd_len;
int res, cmd;
@@ -649,6 +660,13 @@ static void wpa_priv_receive(int sock, void *eloop_ctx, void *sock_ctx)
case PRIVSEP_CMD_SET_MODE:
wpa_priv_cmd_set_mode(iface, cmd_buf, cmd_len);
break;
+ case PRIVSEP_CMD_SET_COUNTRY:
+ pos = cmd_buf;
+ if (pos + cmd_len >= buf + sizeof(buf))
+ break;
+ pos[cmd_len] = '\0';
+ wpa_priv_cmd_set_country(iface, pos);
+ break;
}
}