]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
dirauth: Fix some comments in the router status processing code.
authorteor <teor@torproject.org>
Wed, 5 Jun 2019 22:45:57 +0000 (08:45 +1000)
committerteor <teor@torproject.org>
Thu, 6 Jun 2019 07:26:23 +0000 (17:26 +1000)
Fixes comments in dirserv_router_get_status() and was_router_added_t.

Preparation for 30780 and 16564.

src/feature/dirauth/process_descs.c
src/feature/nodelist/routerlist.c
src/feature/nodelist/routerlist.h

index 656922233e6c8deb79b1fecf2f643d0c4ae51146..17936add5f9c3ceab10eac028ae000605ca820cb 100644 (file)
@@ -216,9 +216,14 @@ dirserv_load_fingerprint_file(void)
 
 #define DISABLE_DISABLING_ED25519
 
-/** Check whether <b>router</b> has a nickname/identity key combination that
- * we recognize from the fingerprint list, or an IP we automatically act on
- * according to our configuration.  Return the appropriate router status.
+/** Check whether <b>router</b> has:
+ * - a nickname/identity key combination that we recognize from the fingerprint
+ *   list,
+ * - an IP we automatically act on according to our configuration,
+ * - an appropriate version, and
+ * - matching pinned keys.
+ *
+ * Return the appropriate router status.
  *
  * If the status is 'FP_REJECT' and <b>msg</b> is provided, set
  * *<b>msg</b> to an explanation of why. */
@@ -236,7 +241,7 @@ dirserv_router_get_status(const routerinfo_t *router, const char **msg,
     return FP_REJECT;
   }
 
-  /* Check for the more usual versions to reject a router first. */
+  /* Check for the more common reasons to reject a router first. */
   const uint32_t r = dirserv_get_status_impl(d, router->nickname,
                                              router->addr, router->or_port,
                                              router->platform, msg, severity);
@@ -535,7 +540,7 @@ dirserv_add_multiple_descriptors(const char *desc, size_t desclen,
   int general = purpose == ROUTER_PURPOSE_GENERAL;
   tor_assert(msg);
 
-  r=ROUTER_ADDED_SUCCESSFULLY; /*Least severe return value. */
+  r=ROUTER_ADDED_SUCCESSFULLY; /* Least severe return value. */
 
   if (!string_is_utf8_no_bom(desc, desclen)) {
     *msg = "descriptor(s) or extrainfo(s) not valid UTF-8 or had BOM.";
index 5788347a0eb54f77469ca401c12377d342827d0e..5948445c969c83919e19d9af4718e32fe61b88d2 100644 (file)
@@ -1459,12 +1459,13 @@ router_descriptor_is_older_than,(const routerinfo_t *router, int seconds))
 }
 
 /** Add <b>router</b> to the routerlist, if we don't already have it.  Replace
- * older entries (if any) with the same key.  Note: Callers should not hold
- * their pointers to <b>router</b> if this function fails; <b>router</b>
- * will either be inserted into the routerlist or freed. Similarly, even
- * if this call succeeds, they should not hold their pointers to
- * <b>router</b> after subsequent calls with other routerinfo's -- they
- * might cause the original routerinfo to get freed.
+ * older entries (if any) with the same key.
+ *
+ * Note: Callers should not hold their pointers to <b>router</b> if this
+ * function fails; <b>router</b> will either be inserted into the routerlist or
+ * freed. Similarly, even if this call succeeds, they should not hold their
+ * pointers to <b>router</b> after subsequent calls with other routerinfo's --
+ * they might cause the original routerinfo to get freed.
  *
  * Returns the status for the operation. Might set *<b>msg</b> if it wants
  * the poster of the router to know something.
index 5771ebb1ab441c0650b8395a90918df94dbf8bac..d7f44cb807dbf095f2f1859ed81af4b55d71e757 100644 (file)
@@ -37,8 +37,8 @@ typedef enum was_router_added_t {
   ROUTER_WAS_NOT_WANTED = -6,
   /* Router descriptor was rejected because it was older than
    * OLD_ROUTER_DESC_MAX_AGE. */
-  ROUTER_WAS_TOO_OLD = -7, /* note contrast with 'NOT_NEW' */
-  /* DOCDOC */
+  ROUTER_WAS_TOO_OLD = -7, /* note contrast with 'ROUTER_IS_ALREADY_KNOWN' */
+  /* Some certs on this router are expired. */
   ROUTER_CERTS_EXPIRED = -8
 } was_router_added_t;