diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-05-15 13:35:08 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-05-15 13:35:08 -0400 |
commit | 2d21a8f4d6f8b010f74d80c5abe969d3e0508460 (patch) | |
tree | 6c887d0d43d3f17306503665eb6247a8a083894d /src/or | |
parent | 081ff5fa83cf146aac8801f90c80ca9ee5729e6a (diff) | |
parent | 1badef5cec84c90d0517715e09b219c7b8450c6c (diff) | |
download | tor-2d21a8f4d6f8b010f74d80c5abe969d3e0508460.tar.gz tor-2d21a8f4d6f8b010f74d80c5abe969d3e0508460.zip |
Merge remote-tracking branch 'public/bug11469_024'
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/directory.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index b94aac45b6..22ba056ee1 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -261,7 +261,7 @@ directory_post_to_dirservers(uint8_t dir_purpose, uint8_t router_purpose, size_t payload_len, size_t extrainfo_len) { const or_options_t *options = get_options(); - int post_via_tor; + dir_indirection_t indirection; const smartlist_t *dirservers = router_get_trusted_dir_servers(); int found = 0; const int exclude_self = (dir_purpose == DIR_PURPOSE_UPLOAD_VOTE || @@ -305,11 +305,19 @@ directory_post_to_dirservers(uint8_t dir_purpose, uint8_t router_purpose, (int) extrainfo_len); } tor_addr_from_ipv4h(&ds_addr, ds->addr); - post_via_tor = purpose_needs_anonymity(dir_purpose, router_purpose) || - !fascist_firewall_allows_address_dir(&ds_addr, ds->dir_port); + if (purpose_needs_anonymity(dir_purpose, router_purpose)) { + indirection = DIRIND_ANONYMOUS; + } else if (!fascist_firewall_allows_address_dir(&ds_addr,ds->dir_port)) { + if (fascist_firewall_allows_address_or(&ds_addr,ds->or_port)) + indirection = DIRIND_ONEHOP; + else + indirection = DIRIND_ANONYMOUS; + } else { + indirection = DIRIND_DIRECT_CONN; + } directory_initiate_command_routerstatus(rs, dir_purpose, router_purpose, - post_via_tor, + indirection, NULL, payload, upload_len, 0); } SMARTLIST_FOREACH_END(ds); if (!found) { |