]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Reject configuration file without interface parameter
authorJouni Malinen <j@w1.fi>
Mon, 29 Apr 2013 10:50:02 +0000 (13:50 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 29 Apr 2013 10:51:42 +0000 (13:51 +0300)
Previously, this was initialized partially, but the interface was
not really started. That could result in eloop_run() returning
immediately and hostapd process getting stopped without any clear
indication of a failure. [Bug 479]

Signed-hostap: Jouni Malinen <j@w1.fi>

hostapd/main.c

index d2ec1a502abe4d6d5eb2bf69845687c0bd501443..1cd4a4a70ddaa15c4244627175d7841f8edb196b 100644 (file)
@@ -301,13 +301,18 @@ hostapd_interface_init(struct hapd_interfaces *interfaces,
                        iface->bss[0]->conf->logger_stdout_level--;
        }
 
-       if (iface->conf->bss[0].iface[0] != 0 ||
-           hostapd_drv_none(iface->bss[0])) {
-               if (hostapd_driver_init(iface) ||
-                       hostapd_setup_interface(iface)) {
-                       hostapd_interface_deinit_free(iface);
-                       return NULL;
-               }
+       if (iface->conf->bss[0].iface[0] == '\0' &&
+           !hostapd_drv_none(iface->bss[0])) {
+               wpa_printf(MSG_ERROR, "Interface name not specified in %s",
+                          config_fname);
+               hostapd_interface_deinit_free(iface);
+               return NULL;
+       }
+
+       if (hostapd_driver_init(iface) ||
+           hostapd_setup_interface(iface)) {
+               hostapd_interface_deinit_free(iface);
+               return NULL;
        }
 
        return iface;