aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-05-22 00:46:55 +0000
committerRoger Dingledine <arma@torproject.org>2007-05-22 00:46:55 +0000
commit82054e0dd2fd482e37d5a6dd9236c6b4d498a897 (patch)
treec356a0c66e05635c6bc26e63b4e3e61a276f3af7
parentde5194eeaad226bee702fbe5170bde2c476933dd (diff)
downloadtor-82054e0dd2fd482e37d5a6dd9236c6b4d498a897.tar.gz
tor-82054e0dd2fd482e37d5a6dd9236c6b4d498a897.zip
Make the NodeFamilies config option work. (Reported by
lodger -- it has never actually worked, even though we added it in Oct 2004.) svn:r10238
-rw-r--r--ChangeLog3
-rw-r--r--src/or/routerlist.c32
2 files changed, 19 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 0e35207cc3..24173f439c 100644
--- a/ChangeLog
+++ b/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.
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index f85dfb97cc..2b900af2e9 100644
--- a/src/or/routerlist.c
+++ b/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) {