[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Use preferred address when looking for bridges by routerinfo_t.
commit 6048f019710c1c4bc225e0a3205dfc45a0a25a00
Author: Linus Nordberg <linus@xxxxxxxxxxx>
Date: Thu Nov 24 18:42:15 2011 +0100
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().
---
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 fbd55dd..edf73ac 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. */
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits