]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Simply geoip_get_country_by_addr based on arma's comment.
authorKarsten Loesing <karsten.loesing@gmx.net>
Thu, 9 Feb 2012 14:22:02 +0000 (15:22 +0100)
committerKarsten Loesing <karsten.loesing@gmx.net>
Thu, 9 Feb 2012 14:22:42 +0000 (15:22 +0100)
src/or/geoip.c

index a72319d28f852c2041379e7bbcf2c909eac2b6bc..5e3735c73ed8db732e35b9a05d7e380b05f96a77 100644 (file)
@@ -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. */