[or-cvs] r10238: Make the NodeFamilies config option work. (Reported by lodge (in tor/trunk: . src/or)

arma at seul.org arma at seul.org
Tue May 22 00:47:00 UTC 2007


Author: arma
Date: 2007-05-21 20:46:55 -0400 (Mon, 21 May 2007)
New Revision: 10238

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/routerlist.c
Log:
Make the NodeFamilies config option work. (Reported by
lodger -- it has never actually worked, even though we added it
in Oct 2004.)


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-05-21 21:48:02 UTC (rev 10237)
+++ tor/trunk/ChangeLog	2007-05-22 00:46:55 UTC (rev 10238)
@@ -116,6 +116,9 @@
 
   o Minor features (other):
     - More unit tests.
+    - Make the NodeFamilies config option work. (Reported by
+      lodger -- it has never actually worked, even though we added it
+      in Oct 2004.)
 
   o Removed features:
     - Removed support for the old binary "version 0" controller protocol.

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-05-21 21:48:02 UTC (rev 10237)
+++ tor/trunk/src/or/routerlist.c	2007-05-22 00:46:55 UTC (rev 10238)
@@ -823,23 +823,23 @@
   if (options->EnforceDistinctSubnets)
     routerlist_add_network_family(sl, router);
 
-  if (!router->declared_family)
-    return;
 
-  /* Add every r such that router declares familyness with r, and r
-   * declares familyhood with router. */
-  SMARTLIST_FOREACH(router->declared_family, const char *, n,
-    {
-      if (!(r = router_get_by_nickname(n, 0)))
-        continue;
-      if (!r->declared_family)
-        continue;
-      SMARTLIST_FOREACH(r->declared_family, const char *, n2,
-        {
-          if (router_nickname_matches(router, n2))
-            smartlist_add(sl, r);
-        });
-    });
+  if (router->declared_family) {
+    /* Add every r such that router declares familyness with r, and r
+     * declares familyhood with router. */
+    SMARTLIST_FOREACH(router->declared_family, const char *, n,
+      {
+        if (!(r = router_get_by_nickname(n, 0)))
+          continue;
+        if (!r->declared_family)
+          continue;
+        SMARTLIST_FOREACH(r->declared_family, const char *, n2,
+          {
+            if (router_nickname_matches(router, n2))
+              smartlist_add(sl, r);
+          });
+      });
+  }
 
   /* If the user declared any families locally, honor those too. */
   for (cl = get_options()->NodeFamilies; cl; cl = cl->next) {



More information about the tor-commits mailing list