summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-03-27 07:05:15 -0400
committerNick Mathewson <nickm@torproject.org>2018-03-27 07:05:15 -0400
commit979c7e5c83531089aa4bf3998ae3353fbdd2031d (patch)
tree20a0b7381814932e9b665b4dde231d5b3a20faa6 /src/or/circuitbuild.c
parent0eed0899cdeadd84dc5323f8ca0a3a13cd3779de (diff)
parent46c2b0ca228d2d95666f28d4e42411dce0a59e15 (diff)
downloadtor-979c7e5c83531089aa4bf3998ae3353fbdd2031d.tar.gz
tor-979c7e5c83531089aa4bf3998ae3353fbdd2031d.zip
Merge branch 'maint-0.3.3'
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index b3b543348c..8b7990e5f6 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -2857,8 +2857,18 @@ extend_info_from_node(const node_t *node, int for_direct_connect)
tor_addr_port_t ap;
int valid_addr = 0;
- if (node->ri == NULL && (node->rs == NULL || node->md == NULL))
- return NULL;
+ const int is_bridge = node_is_a_configured_bridge(node);
+ const int we_use_mds = we_use_microdescriptors_for_circuits(get_options());
+
+ if (is_bridge || !we_use_mds) {
+ /* We need an ri in this case. */
+ if (!node->ri)
+ return NULL;
+ } else {
+ /* Otherwise we need an md. */
+ if (node->rs == NULL || node->md == NULL)
+ return NULL;
+ }
/* Choose a preferred address first, but fall back to an allowed address.
* choose_address returns 1 on success, but get_prim_orport returns 0. */