From d9f1f3533d059627266ddcdb0398b4b32c7158f2 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 28 Dec 2006 21:29:20 +0000 Subject: r11724@Kushana: nickm | 2006-12-28 14:22:35 -0500 Refactor and unify my-ip-addr-changed logic. Make change in IP address or in nameservers reset and relaunch DNS hijacking tests. svn:r9200 --- src/or/dns.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/or/dns.c') diff --git a/src/or/dns.c b/src/or/dns.c index a85b5ee212..e7dbccb4b1 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -1399,6 +1399,11 @@ dns_seems_to_be_broken(void) { return 0; } + +void +dns_reset_correctness_checks(void) +{ +} #else /* !USE_EVENTDNS */ /** Eventdns helper: return true iff the eventdns result err is @@ -1514,6 +1519,8 @@ configure_nameservers(int force) } #endif + dns_servers_relaunch_checks(); + nameservers_configured = 1; return 0; } @@ -1855,6 +1862,28 @@ dns_seems_to_be_broken(void) return dns_is_completely_invalid; } +void +dns_reset_correctness_checks(void) +{ + if (dns_wildcard_response_count) { + strmap_free(dns_wildcard_response_count, _tor_free); + dns_wildcard_response_count = NULL; + } + n_wildcard_requests = 0; + + if (dns_wildcard_list) { + SMARTLIST_FOREACH(dns_wildcard_list, char *, cp, tor_free(cp)); + smartlist_clear(dns_wildcard_list); + } + if (dns_wildcarded_test_address_list) { + SMARTLIST_FOREACH(dns_wildcarded_test_address_list, char *, cp, + tor_free(cp)); + smartlist_clear(dns_wildcarded_test_address_list); + } + dns_wildcard_one_notice_given = dns_wildcard_notice_given = + dns_wildcarded_test_address_notice_given = dns_is_completely_invalid = 0; +} + /** Return true iff we have noticed that the dotted-quad ip has been * returned in response to requests for nonexistent hostnames. */ static int -- cgit v1.2.3-54-g00ecf