diff options
author | Linus Nordberg <linus@torproject.org> | 2012-10-17 12:13:49 +0200 |
---|---|---|
committer | Linus Nordberg <linus@torproject.org> | 2012-10-17 12:13:49 +0200 |
commit | 74c6dafed63a3e51441dd484d652c0e337585949 (patch) | |
tree | 9948935620802fcde87bd16565df62df10cb9249 /src/or/nodelist.c | |
parent | 19ab7b16396804694355923b2254a8e10970f9b2 (diff) | |
download | tor-74c6dafed63a3e51441dd484d652c0e337585949.tar.gz tor-74c6dafed63a3e51441dd484d652c0e337585949.zip |
Two changes lost in rebase resurrected.
Diffstat (limited to 'src/or/nodelist.c')
-rw-r--r-- | src/or/nodelist.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c index 29b6047ac8..f3863032a1 100644 --- a/src/or/nodelist.c +++ b/src/or/nodelist.c @@ -921,12 +921,15 @@ node_get_pref_ipv6_orport(const node_t *node, tor_addr_port_t *ap_out) void node_set_country(node_t *node) { + tor_addr_t addr = TOR_ADDR_NULL; + + /* XXXXipv6 */ if (node->rs) - node->country = geoip_get_country_by_ip(node->rs->addr); + tor_addr_from_ipv4h(&addr, node->rs->addr); else if (node->ri) - node->country = geoip_get_country_by_ip(node->ri->addr); - else - node->country = -1; + tor_addr_from_ipv4h(&addr, node->ri->addr); + + node->country = geoip_get_country_by_addr(&addr); } /** Set the country code of all routers in the routerlist. */ |