commit 74c6dafed63a3e51441dd484d652c0e337585949 Author: Linus Nordberg linus@torproject.org Date: Wed Oct 17 12:13:49 2012 +0200
Two changes lost in rebase resurrected. --- src/or/nodelist.c | 11 +++++++---- src/or/routerset.c | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/or/nodelist.c b/src/or/nodelist.c index 29b6047..f386303 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. */ diff --git a/src/or/routerset.c b/src/or/routerset.c index 263cf79..f3cd592 100644 --- a/src/or/routerset.c +++ b/src/or/routerset.c @@ -216,7 +216,7 @@ routerset_contains(const routerset_t *set, const tor_addr_t *addr, return 3; if (set->countries) { if (country < 0 && addr) - country = geoip_get_country_by_ip(tor_addr_to_ipv4h(addr)); + country = geoip_get_country_by_addr(addr);
if (country >= 0 && country < set->n_countries && bitarray_is_set(set->countries, country))
tor-commits@lists.torproject.org