summaryrefslogtreecommitdiff
path: root/src/or/dns.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-12-28 21:29:20 +0000
committerNick Mathewson <nickm@torproject.org>2006-12-28 21:29:20 +0000
commitd9f1f3533d059627266ddcdb0398b4b32c7158f2 (patch)
treea087dc505639ec0108a087360a489dde56be3f4e /src/or/dns.c
parente5f5b96ca6bc35d22478840600c2dfdf2778950f (diff)
downloadtor-d9f1f3533d059627266ddcdb0398b4b32c7158f2.tar.gz
tor-d9f1f3533d059627266ddcdb0398b4b32c7158f2.zip
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
Diffstat (limited to 'src/or/dns.c')
-rw-r--r--src/or/dns.c29
1 files changed, 29 insertions, 0 deletions
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 <b>err</b> 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 <b>ip</b> has been
* returned in response to requests for nonexistent hostnames. */
static int