From 851f551dd71e51b66a7788dc5422d618d2b8429a Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Sat, 23 Apr 2022 02:48:32 -0400 Subject: geoip: make geoip_get_country_by_* STATIC slightly simplifies code and reduces compiled size. --- src/feature/control/getinfo_geoip.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/feature/control') 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; -- cgit v1.2.3-54-g00ecf