aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/main.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-04-29 10:50:02 (GMT)
committerJouni Malinen <j@w1.fi>2013-04-29 10:51:42 (GMT)
commit61d2ce21af16095f3b4db198b41005841a271a77 (patch)
tree0cba2f2ccc8b5ed3da9fa1f7d628fc2fbb6644d3 /hostapd/main.c
parenta8a7890d7c74fd41f2c4e8d57c1c76d0788f2e4f (diff)
downloadhostap-61d2ce21af16095f3b4db198b41005841a271a77.zip
hostap-61d2ce21af16095f3b4db198b41005841a271a77.tar.gz
hostap-61d2ce21af16095f3b4db198b41005841a271a77.tar.bz2
hostapd: Reject configuration file without interface parameter
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>
Diffstat (limited to 'hostapd/main.c')
-rw-r--r--hostapd/main.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/hostapd/main.c b/hostapd/main.c
index d2ec1a5..1cd4a4a 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -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;