]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add WPA_IGNORE_CONFIG_ERRORS option to continue in case of bad config
authorDmitry Shmidt <dimitrysh@google.com>
Sun, 31 Oct 2010 10:38:49 +0000 (12:38 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 31 Oct 2010 10:38:49 +0000 (12:38 +0200)
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>
hostapd/config_file.c
wpa_supplicant/config_file.c

index a6a3e5c7891554b0a44ed68c0f5aa98973f23a47..e53d9c1175e88dc7f088339156690114344c79cc 100644 (file)
@@ -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;
 }
index 2431e84f35f57294845d3a8c456db5453fe35498..8715a46f06ef65dbdae61d04a804c67ea3d137c3 100644 (file)
@@ -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;
 }