From 0c6eabf08898e0c9f2faa397f2c2bb5fb80b78b9 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 21 Sep 2017 14:34:36 -0400 Subject: Audit all of the "is the network turned off" checks. DisableNetwork is a subset of net_is_disabled(), which is (now) a subset of should_delay_dir_fetches(). Some of these changes are redundant with others higher or lower in the call stack. The ones that I think are behavior-relevant are listed in the changes file. I've also added comments in a few places where the behavior is subtle. Fixes bug 12062; bugfix on various versions. --- src/or/dns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/or/dns.c') diff --git a/src/or/dns.c b/src/or/dns.c index 078bde3ef2..1de606f8d4 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -1648,7 +1648,7 @@ launch_resolve,(cached_resolve_t *resolve)) tor_addr_t a; int r; - if (get_options()->DisableNetwork) + if (net_is_disabled()) return -1; /* What? Nameservers not configured? Sounds like a bug. */ @@ -1883,7 +1883,7 @@ launch_test_addresses(evutil_socket_t fd, short event, void *args) (void)event; (void)args; - if (options->DisableNetwork) + if (net_is_disabled()) return; log_info(LD_EXIT, "Launching checks to see whether our nameservers like to " -- cgit v1.2.3-54-g00ecf