diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-11-04 21:44:31 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-11-04 21:44:31 -0500 |
commit | 626a8b60d7752f38e6587bed9b614c6d039dd9f7 (patch) | |
tree | 227f93749508620dc346d2828ade36f47e123517 /src/or/nodelist.c | |
parent | e5ca5040a56b74f3d0de82d74946f0d9c7d44cc3 (diff) | |
parent | ffddd4de2a69a896be3886b8f48a218a70babbcc (diff) | |
download | tor-626a8b60d7752f38e6587bed9b614c6d039dd9f7.tar.gz tor-626a8b60d7752f38e6587bed9b614c6d039dd9f7.zip |
Merge remote-tracking branch 'linus/bug5053-bug5055'
Conflicts:
src/or/geoip.c
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 c939b0d2a6..5a726377ec 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. */ |