[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #2366 [Tor Relay]: Sync relay's policy with published descriptor.
#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 of extended version:
{{{
--- router.c.origin Mon Jan 3 22:25:30 2011
+++ router.c Sun Jan 9 18:31:32 2011
@@ -1411,9 +1411,16 @@
ri->bandwidthcapacity = hibernating ? 0 : rep_hist_bandwidth_assess();
- 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. */
+ 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");
+ } else {
+ policies_parse_exit_policy(options->ExitPolicy, &ri->exit_policy,
+ options->ExitPolicyRejectPrivate,
+ ri->address, !options->BridgeRelay);
+ }
ri->policy_is_reject_star =
policy_is_reject_star(ri->exit_policy);
@@ -1865,9 +1872,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:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs