diff options
author | Taylor Yu <catalyst@torproject.org> | 2017-09-28 17:15:47 -0500 |
---|---|---|
committer | Taylor Yu <catalyst@torproject.org> | 2017-10-24 17:35:17 -0500 |
commit | 9b60acd4d4ee451fd961b1f03ae46eee960c72ee (patch) | |
tree | b9b5433e81b83734e78a118a3ac4217dc32f201d /src/or/bridges.c | |
parent | 990322fca450d2230067a3035468c5ac7168e760 (diff) | |
download | tor-9b60acd4d4ee451fd961b1f03ae46eee960c72ee.tar.gz tor-9b60acd4d4ee451fd961b1f03ae46eee960c72ee.zip |
Rewrite bridge addresses earlier
Call rewrite_node_address_for_bridge() in
launch_direct_bridge_descriptor_fetch() in case there's an existing
node_t for it.
Diffstat (limited to 'src/or/bridges.c')
-rw-r--r-- | src/or/bridges.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/bridges.c b/src/or/bridges.c index 0818fb0812..0bcc3eeb45 100644 --- a/src/or/bridges.c +++ b/src/or/bridges.c @@ -54,6 +54,8 @@ struct bridge_info_t { }; static void bridge_free(bridge_info_t *bridge); +static void rewrite_node_address_for_bridge(const bridge_info_t *bridge, + node_t *node); /** A list of configured bridges. Whenever we actually get a descriptor * for one, we add it as an entry guard. Note that the order of bridges @@ -571,6 +573,12 @@ launch_direct_bridge_descriptor_fetch(bridge_info_t *bridge) return; } + /* If we already have a node_t for this bridge, rewrite its address now. */ + node_t *node = node_get_mutable_by_id(bridge->identity); + if (node) { + rewrite_node_address_for_bridge(bridge, node); + } + tor_addr_port_t bridge_addrport; memcpy(&bridge_addrport.addr, &bridge->addr, sizeof(tor_addr_t)); bridge_addrport.port = bridge->port; |