summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-02-22 14:10:42 -0500
committerNick Mathewson <nickm@torproject.org>2011-02-22 14:10:42 -0500
commitb7f201f74606aff1f77551449bebe8783a59733a (patch)
tree70ac808a443977ca797e24dafcbda2705e9e9e4f /src/or/router.c
parent46b07462ae636eae1e241d5596b3a1d80c82d7ef (diff)
parentcdc59c198a15195a113d68b2c4fbb270792da533 (diff)
downloadtor-b7f201f74606aff1f77551449bebe8783a59733a.tar.gz
tor-b7f201f74606aff1f77551449bebe8783a59733a.zip
Merge remote branch 'origin/maint-0.2.2'
Conflicts: src/or/policies.c src/or/policies.h
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/or/router.c b/src/or/router.c
index ed998e444f..3f1a0a0e02 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -1411,9 +1411,14 @@ router_rebuild_descriptor(int force)
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_exit_policy_append_reject_star(&ri->exit_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 +1870,7 @@ router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router,
}
/* 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;