diff options
author | Linus Nordberg <linus@nordberg.se> | 2011-11-24 18:42:15 +0100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-11-30 11:55:45 -0500 |
commit | 6048f019710c1c4bc225e0a3205dfc45a0a25a00 (patch) | |
tree | dbc5957209444997b10539c30cace33789451d3e /src/or/circuitbuild.c | |
parent | 7b02d1a73ea4b7b3d780116055bbedaa43d67809 (diff) | |
download | tor-6048f019710c1c4bc225e0a3205dfc45a0a25a00.tar.gz tor-6048f019710c1c4bc225e0a3205dfc45a0a25a00.zip |
Use preferred address when looking for bridges by routerinfo_t.
This should be safe to do for all uses of get_configured_bridge_by_routerinfo().
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index fbd55ddfee..edf73acc4b 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -4856,9 +4856,11 @@ static bridge_info_t * get_configured_bridge_by_routerinfo(const routerinfo_t *ri) { tor_addr_t addr; - tor_addr_from_ipv4h(&addr, ri->addr); - return get_configured_bridge_by_addr_port_digest(&addr, - ri->or_port, ri->cache_info.identity_digest); + uint16_t port; + + router_get_pref_addr_port(ri, &addr, &port); + return get_configured_bridge_by_addr_port_digest(&addr, port, + ri->cache_info.identity_digest); } /** Return 1 if <b>ri</b> is one of our known bridges, else 0. */ |