diff options
author | Linus Nordberg <linus@torproject.org> | 2012-08-31 23:02:19 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-09-04 12:57:22 -0400 |
commit | d827a5495a9d05976f5610655f7e4b5b160a2dac (patch) | |
tree | fc22023b539b7cb60bfb3ee75c2f73c1ffcf7f5d | |
parent | 8b081231b54f1bb33243078fab510a9a543242a0 (diff) | |
download | tor-d827a5495a9d05976f5610655f7e4b5b160a2dac.tar.gz tor-d827a5495a9d05976f5610655f7e4b5b160a2dac.zip |
Take microdesc into account when deciding about preferred OR port.
-rw-r--r-- | src/or/nodelist.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c index 25ed6a61ca..e35039bdb8 100644 --- a/src/or/nodelist.c +++ b/src/or/nodelist.c @@ -888,9 +888,17 @@ node_get_pref_ipv6_orport(const node_t *node, tor_addr_port_t *ap_out) node_assert_ok(node); tor_assert(ap_out); + /* We prefer the microdesc over a potential routerstatus here. They + are not being synchronised atm so there might be a chance that + they differ at some point, f.ex. when flipping + UseMicrodescriptors? -LN */ + if (node->ri) { tor_addr_copy(&ap_out->addr, &node->ri->ipv6_addr); ap_out->port = node->ri->ipv6_orport; + } else if (node->md) { + tor_addr_copy(&ap_out->addr, &node->md->ipv6_addr); + ap_out->port = node->md->ipv6_orport; } else if (node->rs) { tor_addr_copy(&ap_out->addr, &node->rs->ipv6_addr); ap_out->port = node->rs->ipv6_orport; |