]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make sure we never launch an evdns resolve when DisableNetwork is 1
authorNick Mathewson <nickm@torproject.org>
Tue, 29 Nov 2011 22:46:54 +0000 (17:46 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 29 Nov 2011 22:46:54 +0000 (17:46 -0500)
src/or/dns.c

index 8ed95369033f28fb65d29af672d9a89b8f8ff335..beb110acb2cfd6f1c5665f4e8bf745cdded3b4c4 100644 (file)
@@ -1395,6 +1395,10 @@ launch_resolve(edge_connection_t *exitconn)
   int r;
   int options = get_options()->ServerDNSSearchDomains ? 0
     : DNS_QUERY_NO_SEARCH;
+
+  if (get_options()->DisableNetwork)
+    return -1;
+
   /* What? Nameservers not configured?  Sounds like a bug. */
   if (!nameservers_configured) {
     log_warn(LD_EXIT, "(Harmless.) Nameservers not configured, but resolve "
@@ -1601,6 +1605,9 @@ launch_test_addresses(int fd, short event, void *args)
   (void)event;
   (void)args;
 
+  if (options->DisableNetwork)
+    return;
+
   log_info(LD_EXIT, "Launching checks to see whether our nameservers like to "
            "hijack *everything*.");
   /* This situation is worse than the failure-hijacking situation.  When this