diff options
author | Roger Dingledine <arma@torproject.org> | 2008-02-06 12:46:17 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2008-02-06 12:46:17 +0000 |
commit | c054f90f029915679db24d61559a7bdde1a9414b (patch) | |
tree | e70cb32c0b0f96b47992c179dada5195dcaf62fd /src/or/dns.c | |
parent | bbcf406d9fe0c5a51f76e0adb37bf854091246c5 (diff) | |
download | tor-c054f90f029915679db24d61559a7bdde1a9414b.tar.gz tor-c054f90f029915679db24d61559a7bdde1a9414b.zip |
New config option ServerDNSAllowBrokenResolvConf to start a relay
even when the local resolv.conf file is missing, broken, or contains
only unusable nameservers.
Now I can run a local network on my laptop when I'm on an airplane.
svn:r13402
Diffstat (limited to 'src/or/dns.c')
-rw-r--r-- | src/or/dns.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/or/dns.c b/src/or/dns.c index 79af4f0607..e1a56e4c1f 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -1108,7 +1108,7 @@ configure_nameservers(int force) if (stat(conf_fname, &st)) { log_warn(LD_EXIT, "Unable to stat resolver configuration in '%s': %s", conf_fname, strerror(errno)); - return -1; + return options->ServerDNSAllowBrokenResolvConf ? 0 : -1; } if (!force && resolv_conf_fname && !strcmp(conf_fname,resolv_conf_fname) && st.st_mtime == resolv_conf_mtime) { @@ -1123,11 +1123,11 @@ configure_nameservers(int force) if ((r = evdns_resolv_conf_parse(DNS_OPTIONS_ALL, conf_fname))) { log_warn(LD_EXIT, "Unable to parse '%s', or no nameservers in '%s' (%d)", conf_fname, conf_fname, r); - return -1; + return options->ServerDNSAllowBrokenResolvConf ? 0 : -1; } if (evdns_count_nameservers() == 0) { log_warn(LD_EXIT, "Unable to find any nameservers in '%s'.", conf_fname); - return -1; + return options->ServerDNSAllowBrokenResolvConf ? 0 : -1; } tor_free(resolv_conf_fname); resolv_conf_fname = tor_strdup(conf_fname); @@ -1143,13 +1143,13 @@ configure_nameservers(int force) } if (evdns_config_windows_nameservers()) { log_warn(LD_EXIT,"Could not config nameservers."); - return -1; + return options->ServerDNSAllowBrokenResolvConf ? 0 : -1; } if (evdns_count_nameservers() == 0) { log_warn(LD_EXIT, "Unable to find any platform nameservers in " "your Windows configuration. Perhaps you should list a " "ServerDNSResolvConfFile file in your torrc?"); - return -1; + return options->ServerDNSAllowBrokenResolvConf ? 0 : -1; } if (nameservers_configured) evdns_resume(); |