summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@torproject.org>2012-10-20 18:48:58 +0200
committerLinus Nordberg <linus@torproject.org>2012-10-20 20:56:59 +0200
commit817ff962f830188ec4c1a907ebc389a856ea3288 (patch)
tree50954b5f4315db3b66d3ccb991fd818f0ee78935 /src/or/config.c
parente2313d8622aebc2704ce016dfef2be975fa535c3 (diff)
downloadtor-817ff962f830188ec4c1a907ebc389a856ea3288.tar.gz
tor-817ff962f830188ec4c1a907ebc389a856ea3288.zip
Separate IPv4 and IPv6 geoip file loading.
Also add IPv6 geoip file digest to extra info. Also also, add support for IPv6 addresses in control command "ip-to-country".
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 3b95909ed2..5b1f1eed6f 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1512,10 +1512,10 @@ options_act(const or_options_t *old_options)
connection_or_update_token_buckets(get_connection_array(), options);
}
- /* Maybe load geoip file */
+ /* Maybe load IPv4 geoip file */
if (options->GeoIPFile &&
((!old_options || !opt_streq(old_options->GeoIPFile, options->GeoIPFile))
- || !geoip_is_loaded())) {
+ || !geoip_is_loaded(AF_INET))) {
/* XXXX Don't use this "<default>" junk; make our filename options
* understand prefixes somehow. -NM */
/* XXXX024 Reload GeoIPFile on SIGHUP. -NM */
@@ -1530,11 +1530,11 @@ options_act(const or_options_t *old_options)
geoip_load_file(AF_INET, actual_fname, options);
tor_free(actual_fname);
}
- /* And maybe load geoip ipv6 file */
+ /* And maybe load IPv6 geoip file */
if (options->GeoIPv6File &&
((!old_options || !opt_streq(old_options->GeoIPv6File,
options->GeoIPv6File))
- || !geoip_is_loaded())) {
+ || !geoip_is_loaded(AF_INET6))) {
/* XXXX Don't use this "<default>" junk; make our filename options
* understand prefixes somehow. See also comment for GeoIPFile. */
/* XXXX024 Reload GeoIPV6File on SIGHUP. See also comment for
@@ -1573,7 +1573,7 @@ options_act(const or_options_t *old_options)
}
if ((!old_options || !old_options->DirReqStatistics) &&
options->DirReqStatistics) {
- if (geoip_is_loaded()) {
+ if (geoip_is_loaded(AF_INET)) {
geoip_dirreq_stats_init(now);
print_notice = 1;
} else {
@@ -1588,7 +1588,7 @@ options_act(const or_options_t *old_options)
}
if ((!old_options || !old_options->EntryStatistics) &&
options->EntryStatistics && !should_record_bridge_info(options)) {
- if (geoip_is_loaded()) {
+ if (geoip_is_loaded(AF_INET) || geoip_is_loaded(AF_INET6)) {
geoip_entry_stats_init(now);
print_notice = 1;
} else {