summaryrefslogtreecommitdiff
path: root/src/feature/control
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2022-04-23 02:48:32 -0400
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2022-04-23 02:48:32 -0400
commit851f551dd71e51b66a7788dc5422d618d2b8429a (patch)
treeb8df756932ae3b81edac4672d042b05e671914a9 /src/feature/control
parent616c06c0b2748db163cbb6882043d24fdbaaf335 (diff)
downloadtor-851f551dd71e51b66a7788dc5422d618d2b8429a.tar.gz
tor-851f551dd71e51b66a7788dc5422d618d2b8429a.zip
geoip: make geoip_get_country_by_* STATIC
slightly simplifies code and reduces compiled size.
Diffstat (limited to 'src/feature/control')
-rw-r--r--src/feature/control/getinfo_geoip.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/feature/control/getinfo_geoip.c b/src/feature/control/getinfo_geoip.c
index be89c2c641..e2d277f256 100644
--- a/src/feature/control/getinfo_geoip.c
+++ b/src/feature/control/getinfo_geoip.c
@@ -44,10 +44,7 @@ getinfo_helper_geoip(control_connection_t *control_conn,
*errmsg = "GeoIP data not loaded";
return -1;
}
- if (family == AF_INET)
- c = geoip_get_country_by_ipv4(tor_addr_to_ipv4h(&addr));
- else /* AF_INET6 */
- c = geoip_get_country_by_ipv6(tor_addr_to_in6(&addr));
+ c = geoip_get_country_by_addr(&addr);
*answer = tor_strdup(geoip_get_country_name(c));
}
return 0;