hostapd: Add more messages for error paths
Make hostapd more verbose if something goes wrong in interface initialization. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
61d2ce21af
commit
ee28f088a5
1 changed files with 11 additions and 3 deletions
|
@ -194,6 +194,8 @@ static struct hostapd_iface * hostapd_init(const char *config_file)
|
||||||
return hapd_iface;
|
return hapd_iface;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
wpa_printf(MSG_ERROR, "Failed to set up interface with %s",
|
||||||
|
config_file);
|
||||||
if (conf)
|
if (conf)
|
||||||
hostapd_config_free(conf);
|
hostapd_config_free(conf);
|
||||||
if (hapd_iface) {
|
if (hapd_iface) {
|
||||||
|
@ -652,22 +654,28 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hostapd_global_init(&interfaces, entropy_file))
|
if (hostapd_global_init(&interfaces, entropy_file)) {
|
||||||
|
wpa_printf(MSG_ERROR, "Failed to initilize global context");
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize interfaces */
|
/* Initialize interfaces */
|
||||||
for (i = 0; i < interfaces.count; i++) {
|
for (i = 0; i < interfaces.count; i++) {
|
||||||
interfaces.iface[i] = hostapd_interface_init(&interfaces,
|
interfaces.iface[i] = hostapd_interface_init(&interfaces,
|
||||||
argv[optind + i],
|
argv[optind + i],
|
||||||
debug);
|
debug);
|
||||||
if (!interfaces.iface[i])
|
if (!interfaces.iface[i]) {
|
||||||
|
wpa_printf(MSG_ERROR, "Failed to initialize interface");
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hostapd_global_ctrl_iface_init(&interfaces);
|
hostapd_global_ctrl_iface_init(&interfaces);
|
||||||
|
|
||||||
if (hostapd_global_run(&interfaces, daemonize, pid_file))
|
if (hostapd_global_run(&interfaces, daemonize, pid_file)) {
|
||||||
|
wpa_printf(MSG_ERROR, "Failed to start eloop");
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue