Add WPA_IGNORE_CONFIG_ERRORS option to continue in case of bad config

This is an option to continue with wpa_supplicant and hostapd even if
config file has errors. The problem is that these daemons are the best
"candidates" for the config change, so if they can not start because
config file was let's say corrupted, you can not fix it easily.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
This commit is contained in:
Dmitry Shmidt 2010-10-31 12:38:49 +02:00 committed by Jouni Malinen
parent b7412dabd9
commit ae6e1bee67
2 changed files with 4 additions and 0 deletions

View File

@ -2071,12 +2071,14 @@ struct hostapd_config * hostapd_config_read(const char *fname)
if (hostapd_config_check(conf)) if (hostapd_config_check(conf))
errors++; errors++;
#ifndef WPA_IGNORE_CONFIG_ERRORS
if (errors) { if (errors) {
wpa_printf(MSG_ERROR, "%d errors found in configuration file " wpa_printf(MSG_ERROR, "%d errors found in configuration file "
"'%s'", errors, fname); "'%s'", errors, fname);
hostapd_config_free(conf); hostapd_config_free(conf);
conf = NULL; conf = NULL;
} }
#endif /* WPA_IGNORE_CONFIG_ERRORS */
return conf; return conf;
} }

View File

@ -331,11 +331,13 @@ struct wpa_config * wpa_config_read(const char *name)
config->ssid = head; config->ssid = head;
wpa_config_debug_dump_networks(config); wpa_config_debug_dump_networks(config);
#ifndef WPA_IGNORE_CONFIG_ERRORS
if (errors) { if (errors) {
wpa_config_free(config); wpa_config_free(config);
config = NULL; config = NULL;
head = NULL; head = NULL;
} }
#endif /* WPA_IGNORE_CONFIG_ERRORS */
return config; return config;
} }