]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - wilink8-wlan/hostap.git/commitdiff
ap: allow passing "enable=1" param to ADD command
authorEliad Peller <eliad@wizery.com>
Wed, 18 Dec 2013 16:46:04 +0000 (18:46 +0200)
committerEliad Peller <eliad@wizery.com>
Thu, 19 Dec 2013 13:18:13 +0000 (15:18 +0200)
this way we can start the ap right after adding it.
(we'll probably want to replace it with a more generic
IFNAME=<> commands, like in wpa_supplicant)

Signed-off-by: Eliad Peller <eliad@wizery.com>
src/ap/hostapd.c

index b433c5eee16d180bc4a6be79fee710998ee01e2b..f731581f5ae572de0335db893dcbd41d41d01ab0 100644 (file)
@@ -1795,9 +1795,14 @@ int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf)
                return -1;
        *ptr++ = '\0';
 
-       if (os_strncmp(ptr, "config=", 7) == 0)
+       if (os_strncmp(ptr, "config=", 7) == 0) {
                conf_file = ptr + 7;
 
+               ptr = os_strchr(ptr, ' ');
+               if (ptr)
+                       *ptr++ = '\0';
+       }
+
        for (i = 0; i < interfaces->count; i++) {
                if (!os_strcmp(interfaces->iface[i]->conf->bss[0]->iface,
                               buf)) {
@@ -1836,6 +1841,10 @@ int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf)
        if (start_ctrl_iface(hapd_iface) < 0)
                goto fail;
 
+       if (ptr && os_strstr(ptr, "enable=1"))
+               if (hostapd_enable_iface(hapd_iface) < 0)
+                       goto fail;
+
        wpa_printf(MSG_INFO, "Add interface '%s'", conf->bss[0]->iface);
 
        return 0;