]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a warning on unnamed nodes in node_get_by_nickname().
authorNick Mathewson <nickm@torproject.org>
Mon, 30 May 2016 16:03:03 +0000 (12:03 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 30 May 2016 16:03:03 +0000 (12:03 -0400)
There was a > that should have been an ==, and a missing !.  These
together prevented us from issuing a warning in the case that a
nickname matched an Unnamed node only.

Fixes bug 19203; bugfix on 0.2.3.1-alpha.

changes/bug19203 [new file with mode: 0644]
src/or/nodelist.c

diff --git a/changes/bug19203 b/changes/bug19203
new file mode 100644 (file)
index 0000000..96bc1e8
--- /dev/null
@@ -0,0 +1,4 @@
+  o Major bugfixes (user interface):
+    - Correctly give a warning in the cases where a relay is specified by
+      nickname, and one such relay is found, but it is not officially Named.
+      Fixes bug 19203; bugfix on 0.2.3.1-alpha.
index 2f272a1d567da6e02da2ab9cb40e952c57e2a38f..880b7957879e8a5690c71c37d80a5a9b53c1845f 100644 (file)
@@ -587,10 +587,10 @@ node_get_by_nickname,(const char *nickname, int warn_if_unnamed))
                  "but none is listed as Named in the directory consensus. "
                  "Choosing one arbitrarily.", nickname);
       }
-    } else if (smartlist_len(matches)>1 && warn_if_unnamed) {
+    } else if (smartlist_len(matches)==1 && warn_if_unnamed) {
       char fp[HEX_DIGEST_LEN+1];
       node_t *node = smartlist_get(matches, 0);
-      if (node->name_lookup_warned) {
+      if (node->name_lookup_warned) {
         base16_encode(fp, sizeof(fp), node->identity, DIGEST_LEN);
         log_warn(LD_CONFIG,
                  "You specified a server \"%s\" by name, but the directory "