aboutsummaryrefslogtreecommitdiff
path: root/src/feature/dirclient/dirclient.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2021-02-17 11:00:14 -0500
committerDavid Goulet <dgoulet@torproject.org>2021-02-22 08:52:06 -0500
commit38649b4f9522d5fc2b186d2a02cefb9abaefc519 (patch)
treefe48cc31653b7178c3566e28786c2c9ea565f075 /src/feature/dirclient/dirclient.c
parentc0589d06be698ea864e2c58e40ffda0f228440d4 (diff)
downloadtor-38649b4f9522d5fc2b186d2a02cefb9abaefc519.tar.gz
tor-38649b4f9522d5fc2b186d2a02cefb9abaefc519.zip
relay: Remove dirport reachability self test
Regular relays are about to get their DirPort removed so that reachability test is not useful anymore Authorities will still use the DirPort but because network reentry towards their DirPort is now denied network wide, this test is not useful anymore and so it should simply be considered reachable at all time. Part of #40282 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/dirclient/dirclient.c')
-rw-r--r--src/feature/dirclient/dirclient.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/feature/dirclient/dirclient.c b/src/feature/dirclient/dirclient.c
index c5b0d19dd7..439936f83a 100644
--- a/src/feature/dirclient/dirclient.c
+++ b/src/feature/dirclient/dirclient.c
@@ -696,24 +696,6 @@ directory_choose_address_routerstatus(const routerstatus_t *status,
return 0;
}
-/** Return true iff <b>conn</b> is the client side of a directory connection
- * we launched to ourself in order to determine the reachability of our
- * dir_port. */
-static int
-directory_conn_is_self_reachability_test(dir_connection_t *conn)
-{
- if (conn->requested_resource &&
- !strcmpstart(conn->requested_resource,"authority")) {
- const routerinfo_t *me = router_get_my_routerinfo();
- if (me &&
- router_digest_is_me(conn->identity_digest) &&
- tor_addr_eq(&TO_CONN(conn)->addr, &me->ipv4_addr) &&
- me->ipv4_dirport == conn->base_.port)
- return 1;
- }
- return 0;
-}
-
/** Called when we are unable to complete the client's request to a directory
* server due to a network error: Mark the router as down and try again if
* possible.
@@ -726,9 +708,6 @@ connection_dir_client_request_failed(dir_connection_t *conn)
* failed. */
entry_guard_failed(&conn->guard_state);
}
- if (directory_conn_is_self_reachability_test(conn)) {
- return; /* this was a test fetch. don't retry. */
- }
if (!entry_list_is_constrained(get_options()))
router_set_status(conn->identity_digest, 0); /* don't try this one again */
if (conn->base_.purpose == DIR_PURPOSE_FETCH_SERVERDESC ||
@@ -2516,8 +2495,6 @@ handle_response_fetch_desc(dir_connection_t *conn,
SMARTLIST_FOREACH(which, char *, cp, tor_free(cp));
smartlist_free(which);
}
- if (directory_conn_is_self_reachability_test(conn))
- router_dirport_found_reachable();
return 0;
}