Browse Source

Make the NodeFamilies config option work. (Reported by
lodger -- it has never actually worked, even though we added it
in Oct 2004.)


svn:r10238

Roger Dingledine 18 years ago
parent
commit
82054e0dd2
2 changed files with 19 additions and 16 deletions
  1. 3 0
      ChangeLog
  2. 16 16
      src/or/routerlist.c

+ 3 - 0
ChangeLog

@@ -116,6 +116,9 @@ Changes in version 0.2.0.1-alpha - 2007-??-??
 
   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.

+ 16 - 16
src/or/routerlist.c

@@ -823,23 +823,23 @@ routerlist_add_family(smartlist_t *sl, routerinfo_t *router)
   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) {