diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-04-03 19:13:36 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-04-26 23:54:17 -0400 |
commit | 128582cc1f9fd363f3fb2a96b61fde1701a56970 (patch) | |
tree | faffa809cee30d7ab98a48591e3b35586ca4ad0c /src/or/config.c | |
parent | 84f0e87c6a6629d047a39f658b7f7c96767219ca (diff) | |
download | tor-128582cc1f9fd363f3fb2a96b61fde1701a56970.tar.gz tor-128582cc1f9fd363f3fb2a96b61fde1701a56970.zip |
Simplify calls to routerset_equal
The routerset_equal function explicitly handles NULL inputs, so
there's no need to check inputs for NULL before calling it.
Also fix a bug in routerset_equal where a non-NULL routerset with no
entries didn't get counted as equal to a NULL routerset. This was
untriggerable, I think, but potentially annoying down the road.
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/or/config.c b/src/or/config.c index 404e648dba..44cde85dc8 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1260,15 +1260,11 @@ options_act(or_options_t *old_options) /* Check for transitions that need action. */ if (old_options) { if ((options->UseEntryGuards && !old_options->UseEntryGuards) || - (options->ExcludeNodes && - !routerset_equal(old_options->ExcludeNodes,options->ExcludeNodes)) || - (options->ExcludeExitNodes && - !routerset_equal(old_options->ExcludeExitNodes, - options->ExcludeExitNodes)) || - (options->EntryNodes && - !routerset_equal(old_options->EntryNodes, options->EntryNodes)) || - (options->ExitNodes && - !routerset_equal(old_options->ExitNodes, options->ExitNodes)) || + !routerset_equal(old_options->ExcludeNodes,options->ExcludeNodes) || + !routerset_equal(old_options->ExcludeExitNodes, + options->ExcludeExitNodes) || + !routerset_equal(old_options->EntryNodes, options->EntryNodes) || + !routerset_equal(old_options->ExitNodes, options->ExitNodes) || options->StrictNodes != old_options->StrictNodes) { log_info(LD_CIRC, "Changed to using entry guards, or changed preferred or " |