aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-07-16 11:14:59 +0200
committerNick Mathewson <nickm@torproject.org>2014-07-16 11:14:59 +0200
commit4da4c4c63f02e9551eaeb8ad9ce5c6f2d1f34ef9 (patch)
treefb9c916cbd59baf6f2497710db26d8a70a968c7c /src/or
parent7591ce64fbaae8d480224a93d62abda10011c2ba (diff)
downloadtor-4da4c4c63f02e9551eaeb8ad9ce5c6f2d1f34ef9.tar.gz
tor-4da4c4c63f02e9551eaeb8ad9ce5c6f2d1f34ef9.zip
Apply GeoIPExcludeUnknown before checking transitions
Otherwise, it always seems as though our Exclude* options have changed, since we're comparing modified to unmodified values. Patch from qwerty1. Fixes bug 9801. Bugfix on 0.2.4.10-alpha, where GeoIPExcludeUnknown was introduced.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/config.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 10df83975f..2c3dfc21f4 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1592,6 +1592,20 @@ options_act(const or_options_t *old_options)
return -1;
}
+ config_maybe_load_geoip_files_(options, old_options);
+
+ if (geoip_is_loaded(AF_INET) && options->GeoIPExcludeUnknown) {
+ /* ExcludeUnknown is true or "auto" */
+ const int is_auto = options->GeoIPExcludeUnknown == -1;
+ int changed;
+
+ changed = routerset_add_unknown_ccs(&options->ExcludeNodes, is_auto);
+ changed += routerset_add_unknown_ccs(&options->ExcludeExitNodes, is_auto);
+
+ if (changed)
+ routerset_add_unknown_ccs(&options->ExcludeExitNodesUnion_, is_auto);
+ }
+
/* Check for transitions that need action. */
if (old_options) {
int revise_trackexithosts = 0;
@@ -1687,20 +1701,6 @@ options_act(const or_options_t *old_options)
connection_or_update_token_buckets(get_connection_array(), options);
}
- config_maybe_load_geoip_files_(options, old_options);
-
- if (geoip_is_loaded(AF_INET) && options->GeoIPExcludeUnknown) {
- /* ExcludeUnknown is true or "auto" */
- const int is_auto = options->GeoIPExcludeUnknown == -1;
- int changed;
-
- changed = routerset_add_unknown_ccs(&options->ExcludeNodes, is_auto);
- changed += routerset_add_unknown_ccs(&options->ExcludeExitNodes, is_auto);
-
- if (changed)
- routerset_add_unknown_ccs(&options->ExcludeExitNodesUnion_, is_auto);
- }
-
if (options->CellStatistics || options->DirReqStatistics ||
options->EntryStatistics || options->ExitPortStatistics ||
options->ConnDirectionStatistics ||