diff options
author | Karsten Loesing <karsten.loesing@gmx.net> | 2012-02-09 15:22:02 +0100 |
---|---|---|
committer | Karsten Loesing <karsten.loesing@gmx.net> | 2012-02-09 15:22:42 +0100 |
commit | cc94a48ff47a59fb6d7ce0a61aebeb6f8f859b2b (patch) | |
tree | 0fd9fa953824aadb3df10f707b9bacfd0e972c04 /src/or/geoip.c | |
parent | 218193d38d2cebc72123255f8035fe3fa02d3dc5 (diff) | |
download | tor-cc94a48ff47a59fb6d7ce0a61aebeb6f8f859b2b.tar.gz tor-cc94a48ff47a59fb6d7ce0a61aebeb6f8f859b2b.zip |
Simply geoip_get_country_by_addr based on arma's comment.
Diffstat (limited to 'src/or/geoip.c')
-rw-r--r-- | src/or/geoip.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/or/geoip.c b/src/or/geoip.c index a72319d28f..5e3735c73e 100644 --- a/src/or/geoip.c +++ b/src/or/geoip.c @@ -269,13 +269,11 @@ geoip_get_country_by_ip(uint32_t ipaddr) int geoip_get_country_by_addr(const tor_addr_t *addr) { - uint32_t ipaddr; if (tor_addr_family(addr) != AF_INET) { /*XXXX IP6 support ipv6 geoip.*/ return -1; } - ipaddr = tor_addr_to_ipv4h(addr); - return geoip_get_country_by_ip(ipaddr); + return geoip_get_country_by_ip(tor_addr_to_ipv4h(addr)); } /** Return the number of countries recognized by the GeoIP database. */ |