diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-05-10 11:12:24 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-05-10 11:12:24 -0400 |
commit | d76cffda601eed40d6a81eadb1240d98ee1e70a2 (patch) | |
tree | a153bd842af1f4f8741490fe71245bf99f913d84 /src/or/router.c | |
parent | 8266d193a608445b0d8675a83733870a2733e2b9 (diff) | |
parent | 9fc1346df2e1402a6895bdf826f8757da7e49608 (diff) | |
download | tor-d76cffda601eed40d6a81eadb1240d98ee1e70a2.tar.gz tor-d76cffda601eed40d6a81eadb1240d98ee1e70a2.zip |
Merge remote-tracking branch 'public/my-family-list-fix-4498'
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/or/router.c b/src/or/router.c index f062c247ca..642f415a38 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -2281,14 +2281,12 @@ router_build_fresh_descriptor(routerinfo_t **r, extrainfo_t **e) } if (options->MyFamily && ! options->BridgeRelay) { - smartlist_t *family; if (!warned_nonexistent_family) warned_nonexistent_family = smartlist_new(); - family = smartlist_new(); ri->declared_family = smartlist_new(); - smartlist_split_string(family, options->MyFamily, ",", - SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK|SPLIT_STRIP_SPACE, 0); - SMARTLIST_FOREACH_BEGIN(family, char *, name) { + config_line_t *family; + for (family = options->MyFamily; family; family = family->next) { + char *name = family->value; const node_t *member; if (!strcasecmp(name, options->Nickname)) goto skip; /* Don't list ourself, that's redundant */ @@ -2327,13 +2325,11 @@ router_build_fresh_descriptor(routerinfo_t **r, extrainfo_t **e) } skip: tor_free(name); - } SMARTLIST_FOREACH_END(name); + } /* remove duplicates from the list */ smartlist_sort_strings(ri->declared_family); smartlist_uniq_strings(ri->declared_family); - - smartlist_free(family); } /* Now generate the extrainfo. */ |