diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-05-13 16:22:58 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-05-13 16:28:50 -0400 |
commit | a3ae591115ba5c4a43ff4fa3839be274aac9e5c3 (patch) | |
tree | 7b0fd9a7c86faa3c5677a6c47aaa4e4ce78cf4df /src/or/config.c | |
parent | ec81d17d0c03d73f4d4acd9102893113b2883d76 (diff) | |
download | tor-a3ae591115ba5c4a43ff4fa3839be274aac9e5c3.tar tor-a3ae591115ba5c4a43ff4fa3839be274aac9e5c3.tar.gz |
When TrackExitHosts changes, remove all no-longer-valid mappings
This bug couldn't happen when TrackExitHosts changed in torrc, since
the SIGHUP to reload the torrc would clear out all the transient
addressmap entries before. But if you used SETCONF to change
TrackExitHosts, old entries would be left alone: that's a bug, and so
this is a bugfix on Tor 0.1.0.1-rc.
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c index a7ff28f46..147cc66b6 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1264,6 +1264,7 @@ options_act(or_options_t *old_options) /* Check for transitions that need action. */ if (old_options) { + int revise_trackexithosts = 0; if ((options->UseEntryGuards && !old_options->UseEntryGuards) || !routerset_equal(old_options->ExcludeNodes,options->ExcludeNodes) || !routerset_equal(old_options->ExcludeExitNodes, @@ -1276,9 +1277,16 @@ options_act(or_options_t *old_options) "excluded node lists. Abandoning previous circuits."); circuit_mark_all_unused_circs(); circuit_expire_all_dirty_circs(); - addressmap_clear_excluded_trackexithosts(options); + revise_trackexithosts = 1; } + if (!smartlist_strings_eq(old_options->TrackHostExits, + options->TrackHostExits)) + revise_trackexithosts = 1; + + if (revise_trackexithosts) + addressmap_clear_excluded_trackexithosts(options); + /* How long should we delay counting bridge stats after becoming a bridge? * We use this so we don't count people who used our bridge thinking it is * a relay. If you change this, don't forget to change the log message |