diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-09-21 21:48:22 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-09-21 21:48:22 +0000 |
commit | e4a9b4de4ec0573721b5e0e0969c9ea2f9e70baf (patch) | |
tree | 7c58d803ea7de0ca2f4dd2806b20b259036c25a6 /src/or/main.c | |
parent | 04bec6757494a7ac3a798bde068abf151c8a8242 (diff) | |
download | tor-e4a9b4de4ec0573721b5e0e0969c9ea2f9e70baf.tar.gz tor-e4a9b4de4ec0573721b5e0e0969c9ea2f9e70baf.zip |
r8875@Kushana: nickm | 2006-09-21 16:46:28 -0400
Resolve bug 330: detect ISPs that want to hijack failing DNS requests and basically domain-squat the entire internet.
svn:r8440
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/or/main.c b/src/or/main.c index 984563f2ef..c40d466e61 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -722,6 +722,7 @@ run_scheduled_events(time_t now) static time_t time_to_try_getting_descriptors = 0; static time_t time_to_reset_descriptor_failures = 0; static time_t time_to_add_entropy = 0; + static time_t time_to_check_for_wildcarded_dns = 0; or_options_t *options = get_options(); int i; int have_dir_info; @@ -923,6 +924,20 @@ run_scheduled_events(time_t now) * we'll pass it to poll/select and bad things will happen. */ close_closeable_connections(); + + /** 9. and if we're a server, check whether our DNS is telling stories to + * us. */ + if (server_mode(options) && time_to_check_for_wildcarded_dns < now) { + if (!time_to_check_for_wildcarded_dns) { + time_to_check_for_wildcarded_dns = now + 60 + crypto_rand_int(120); + } else { + dns_launch_wildcard_checks(); + time_to_check_for_wildcarded_dns = now + 12*3600 + + crypto_rand_int(12*3600); + } + } + + } static struct event *timeout_event = NULL; |