From ae6e1bee67231b1c0bb69b6742ac99eba4e1dd14 Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Sun, 31 Oct 2010 12:38:49 +0200 Subject: [PATCH] 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 --- hostapd/config_file.c | 2 ++ wpa_supplicant/config_file.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index a6a3e5c78..e53d9c117 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -2071,12 +2071,14 @@ struct hostapd_config * hostapd_config_read(const char *fname) if (hostapd_config_check(conf)) errors++; +#ifndef WPA_IGNORE_CONFIG_ERRORS if (errors) { wpa_printf(MSG_ERROR, "%d errors found in configuration file " "'%s'", errors, fname); hostapd_config_free(conf); conf = NULL; } +#endif /* WPA_IGNORE_CONFIG_ERRORS */ return conf; } diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index 2431e84f3..8715a46f0 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -331,11 +331,13 @@ struct wpa_config * wpa_config_read(const char *name) config->ssid = head; wpa_config_debug_dump_networks(config); +#ifndef WPA_IGNORE_CONFIG_ERRORS if (errors) { wpa_config_free(config); config = NULL; head = NULL; } +#endif /* WPA_IGNORE_CONFIG_ERRORS */ return config; }