summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-07-07 16:10:56 +1000
committerNick Mathewson <nickm@torproject.org>2016-07-26 19:31:05 -0400
commit64bf6b70a889ee53978d70a2efc3c2a08a088826 (patch)
treef2b7c6a4f1d72c3b752ae09e261817fb903ec893 /src/or/router.c
parentdfa41ac0f32729f9d5a731681d826ec3006f6fb5 (diff)
downloadtor-64bf6b70a889ee53978d70a2efc3c2a08a088826.tar.gz
tor-64bf6b70a889ee53978d70a2efc3c2a08a088826.zip
Check that extend_info_from_router is never called on a client
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/or/router.c b/src/or/router.c
index a671591ad7..f858fbef2d 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -1284,15 +1284,17 @@ decide_to_advertise_begindir(const or_options_t *options,
}
/** Allocate and return a new extend_info_t that can be used to build
- * a circuit to or through the router <b>r</b>. Use the primary
- * address of the router unless <b>for_direct_connect</b> is true, in
- * which case the preferred address is used instead. */
+ * a circuit to or through the router <b>r</b>. Uses the primary
+ * address of the router, so should only be called on a server. */
static extend_info_t *
extend_info_from_router(const routerinfo_t *r)
{
tor_addr_port_t ap;
tor_assert(r);
+ /* Make sure we don't need to check address reachability */
+ tor_assert_nonfatal(!router_skip_or_reachability(get_options(), 0));
+
router_get_prim_orport(r, &ap);
return extend_info_new(r->nickname, r->cache_info.identity_digest,
r->onion_pkey, r->onion_curve25519_pkey,