[tor-bugs] #2366 [Tor Relay]: Sync relay's policy with published descriptor.
Tor Bug Tracker & Wiki
torproject-admin at torproject.org
Sun Jan 9 16:37:56 UTC 2011
#2366: Sync relay's policy with published descriptor.
---------------------+------------------------------------------------------
Reporter: postman | Type: defect
Status: new | Priority: normal
Milestone: | Component: Tor Relay
Version: | Keywords: dns reject policy
Parent: |
---------------------+------------------------------------------------------
Comment(by postman):
Extended version:
{{{
--- router.c.origin Mon Jan 3 22:25:30 2011
+++ router.c Sun Jan 9 16:34:36 2011
@@ -1414,6 +1414,15 @@
policies_parse_exit_policy(options->ExitPolicy, &ri->exit_policy,
options->ExitPolicyRejectPrivate,
ri->address, !options->BridgeRelay);
+
+ if (dns_seems_to_be_broken() || has_dns_init_failed()) {
+ /* DNS is screwed up; don't claim to be an exit. */
+ addr_policy_list_free(ri->exit_policy);
+ ri->exit_policy = NULL; /* empty */
+ policies_parse_exit_policy(NULL, &ri->exit_policy, 0, NULL, 0);
+ if (!ri->exit_policy || !policy_is_reject_star(ri->exit_policy))
+ log_warn(LD_BUG, "Unable to produce reject star policy");
+ }
ri->policy_is_reject_star =
policy_is_reject_star(ri->exit_policy);
@@ -1865,9 +1874,7 @@
}
/* Write the exit policy to the end of 's'. */
- if (dns_seems_to_be_broken() || has_dns_init_failed() ||
- !router->exit_policy || !smartlist_len(router->exit_policy)) {
- /* DNS is screwed up; don't claim to be an exit. */
+ if (!router->exit_policy || !smartlist_len(router->exit_policy)) {
strlcat(s+written, "reject *:*\n", maxlen-written);
written += strlen("reject *:*\n");
tmpe = NULL;
}}}
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/2366#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list