diff options
author | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-04-28 16:07:47 +1000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-05-05 08:16:28 -0400 |
commit | 9aa280cc0c105bc282c3c1c0dee385387251ab12 (patch) | |
tree | 12166fa2c45f18e724a93f13e6c0d8d93de21a84 /src/or/directory.c | |
parent | 88deb52d559fbec17be4a634137ac4b6c207ce06 (diff) | |
download | tor-9aa280cc0c105bc282c3c1c0dee385387251ab12.tar.gz tor-9aa280cc0c105bc282c3c1c0dee385387251ab12.zip |
Only choose directory DirPorts on relays
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index a03283e7fc..8dc018a662 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -630,6 +630,7 @@ directory_choose_address_routerstatus(const routerstatus_t *status, tor_assert(use_or_ap != NULL); tor_assert(use_dir_ap != NULL); + const or_options_t *options = get_options(); int have_or = 0, have_dir = 0; /* We expect status to have at least one reachable address if we're @@ -671,10 +672,11 @@ directory_choose_address_routerstatus(const routerstatus_t *status, } /* DirPort connections - * DIRIND_ONEHOP uses ORPort, but may fall back to the DirPort */ + * DIRIND_ONEHOP uses ORPort, but may fall back to the DirPort on relays */ if (indirection == DIRIND_DIRECT_CONN || indirection == DIRIND_ANON_DIRPORT || - indirection == DIRIND_ONEHOP) { + (indirection == DIRIND_ONEHOP + && !directory_must_use_begindir(options))) { have_dir = fascist_firewall_choose_address_rs(status, FIREWALL_DIR_CONNECTION, 0, use_dir_ap); |