]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Warn at parse time for routerstatus entry missing a microdesc consensus
authorNick Mathewson <nickm@torproject.org>
Tue, 31 Jul 2012 15:00:18 +0000 (11:00 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 31 Jul 2012 15:01:57 +0000 (11:01 -0400)
In 0.2.3.18-rc, we started warning on this case while building a
list of missing microdescriptor digests.  That turned out to spam
the logs; instead let's warn at parse time.

Partial fix for bug 6404.

changes/bug6404
src/or/microdesc.c
src/or/routerparse.c

index 64d459418faf0d267488962e949c6cb966b4ca4d..77081481ce9257844e551a083cba1d009daf4c78 100644 (file)
@@ -10,3 +10,7 @@
       agree on a microdescriptor.  Partial fix for bug 6404; fix on
       0.2.2.6-alpha.
 
+    - Move log message when unable to find a microdesc in a
+      routerstatus entry to parse time. Previously we'd spam this
+      warning every time we tried to figure out which microdescriptors
+      to download. Partial fix for bug 6404; fix on 0.2.3.18-rc.
index 9395a9a05113e9333d98ad2dcdc89060b50dc127..c1ac1c3758532913745371c324eb33189e1c17b6 100644 (file)
@@ -643,13 +643,8 @@ microdesc_list_missing_digest256(networkstatus_t *ns, microdesc_cache_t *cache,
       continue;
     if (skip && digestmap_get(skip, rs->descriptor_digest))
       continue;
-    if (tor_mem_is_zero(rs->descriptor_digest, DIGEST256_LEN)) {
-      log_info(LD_BUG, "Found an entry in networkstatus with no "
-               "microdescriptor digest. (Router %s=%s at %s:%d.)",
-               rs->nickname, hex_str(rs->identity_digest, DIGEST_LEN),
-               fmt_addr32(rs->addr), rs->or_port);
+    if (tor_mem_is_zero(rs->descriptor_digest, DIGEST256_LEN))
       continue;
-    }
     /* XXXX Also skip if we're a noncache and wouldn't use this router.
      * XXXX NM Microdesc
      */
index 4231a17c67a3a97b475041d15fa3d7d41ab86b8b..8b69ad1d1395e3b9d78fb614bd2ec0710e6f9e8f 100644 (file)
@@ -2201,6 +2201,11 @@ routerstatus_parse_entry_from_string(memarea_t *area,
                  escaped(tok->args[0]));
         goto err;
       }
+    } else {
+      log_info(LD_BUG, "Found an entry in networkstatus with no "
+               "microdescriptor digest. (Router %s=%s at %s:%d.)",
+               rs->nickname, hex_str(rs->identity_digest, DIGEST_LEN),
+               fmt_addr32(rs->addr), rs->or_port);
     }
   }