Make the NodeFamilies config option work. (Reported by

lodger -- it has never actually worked, even though we added it
in Oct 2004.)


svn:r10238
This commit is contained in:
Roger Dingledine
2007-05-22 00:46:55 +00:00
parent de5194eeaa
commit 82054e0dd2
2 changed files with 19 additions and 16 deletions
+3
View File
@@ -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
View File
@@ -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) {