summaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>2015-12-14 17:23:10 +1100
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-01-29 07:13:57 +1100
commit2d33d192fc4dd0da2a2e038dd87b277f8e9b90de (patch)
treefdfa9777f319a4286d04b095c1e1058356c74d25 /src/or/directory.c
parent4460feaf2850ef0fb027a2d01786a5bbaee056dc (diff)
downloadtor-2d33d192fc4dd0da2a2e038dd87b277f8e9b90de.tar.gz
tor-2d33d192fc4dd0da2a2e038dd87b277f8e9b90de.zip
Add ClientUseIPv4 and ClientPreferIPv6DirPort torrc options
ClientUseIPv4 0 tells tor to avoid IPv4 client connections. ClientPreferIPv6DirPort 1 tells tor to prefer IPv6 directory connections. Refactor policy for IPv4/IPv6 preferences. Fix a bug where node->ipv6_preferred could become stale if ClientPreferIPv6ORPort was changed after the consensus was loaded. Update documentation, existing code, add unit tests.
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 8370095e92..d5531d88da 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -313,7 +313,6 @@ directory_post_to_dirservers(uint8_t dir_purpose, uint8_t router_purpose,
SMARTLIST_FOREACH_BEGIN(dirservers, dir_server_t *, ds) {
routerstatus_t *rs = &(ds->fake_status);
size_t upload_len = payload_len;
- tor_addr_t ds_addr;
if ((type & ds->type) == 0)
continue;
@@ -344,11 +343,12 @@ directory_post_to_dirservers(uint8_t dir_purpose, uint8_t router_purpose,
log_info(LD_DIR, "Uploading an extrainfo too (length %d)",
(int) extrainfo_len);
}
- tor_addr_from_ipv4h(&ds_addr, ds->addr);
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))
+ } else if (!fascist_firewall_allows_dir_server(ds,
+ FIREWALL_DIR_CONNECTION,
+ 0)) {
+ if (fascist_firewall_allows_dir_server(ds, FIREWALL_OR_CONNECTION, 0))
indirection = DIRIND_ONEHOP;
else
indirection = DIRIND_ANONYMOUS;