aboutsummaryrefslogtreecommitdiff
path: root/src/feature/client
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2022-08-09 16:39:26 -0400
committerRoger Dingledine <arma@torproject.org>2022-08-09 16:39:26 -0400
commitd48eaff86d5d2bd0df2b0974abf28652934b5cc6 (patch)
tree18163a07cb82485d3c145f471a1cbe5e1afaadcb /src/feature/client
parent7b1fffe0ddfb78234bddba4aae5800482d8b01fb (diff)
downloadtor-d48eaff86d5d2bd0df2b0974abf28652934b5cc6.tar.gz
tor-d48eaff86d5d2bd0df2b0974abf28652934b5cc6.zip
ignore families for L2 guard independence
mike is concerned that we would get too much exposure to adversaries, if we enforce that none of our L2 guards can be in the same family. this change set now essentially finishes the feature that commit a77727cdc was attempting to add, but strips the "_and_family" part of that plan.
Diffstat (limited to 'src/feature/client')
-rw-r--r--src/feature/client/entrynodes.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/feature/client/entrynodes.c b/src/feature/client/entrynodes.c
index 493571173e..e7324487da 100644
--- a/src/feature/client/entrynodes.c
+++ b/src/feature/client/entrynodes.c
@@ -4139,10 +4139,11 @@ maintain_layer2_guards(void)
/* First gather the exclusions based on our current L2 guards */
smartlist_t *excluded = smartlist_new();
SMARTLIST_FOREACH_BEGIN(layer2_guards, layer2_guard_t *, g) {
- /* Exclude existing L2 guard + family so that we don't double-pick. */
+ /* Exclude existing L2 guard so that we don't double-pick it.
+ * But, it's ok if they come from the same family. */
const node_t *existing = node_get_by_id(g->identity);
if (existing)
- nodelist_add_node_and_family(excluded, existing);
+ smartlist_add(excluded, (node_t *)existing);
} SMARTLIST_FOREACH_END(g);
/* Add required guards to the list */
@@ -4167,8 +4168,9 @@ maintain_layer2_guards(void)
// Nickname can also be None here because it is looked up later
control_event_guard("None", layer2_guard->identity,
"GOOD_L2");
- /* Exclude this node and its family so that we don't double-pick. */
- nodelist_add_node_and_family(excluded, choice);
+ /* Exclude this node so that we don't double-pick it. (Again, coming
+ * from the same family is ok here.) */
+ smartlist_add(excluded, (node_t *)choice);
}
/* Some cleanup */