aboutsummaryrefslogtreecommitdiff
path: root/src/feature/dirparse
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2021-10-08 11:14:53 -0400
committerAlexander Færøy <ahf@torproject.org>2021-10-21 12:57:20 +0000
commitfc542167cb568fc3805275e2405990423cf87e3b (patch)
tree92e4f3b18751d4af3e222cc137e732345d0d3e34 /src/feature/dirparse
parentba5a71b91325b52f27fff76b736af9ddd16ba540 (diff)
downloadtor-fc542167cb568fc3805275e2405990423cf87e3b.tar.gz
tor-fc542167cb568fc3805275e2405990423cf87e3b.zip
Implement a MiddleOnly flag for vote generation.
This proposal implements part of Prop335; it's based on a patch from Neel Chauhan. When configured to do so, authorities will assign a MiddleOnly flag to certain relays. Any relay which an authority gives this flag will not get Exit, V2Dir, Guard, or HSDir, and might get BadExit if the authority votes for that one.
Diffstat (limited to 'src/feature/dirparse')
-rw-r--r--src/feature/dirparse/ns_parse.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/feature/dirparse/ns_parse.c b/src/feature/dirparse/ns_parse.c
index 947b3810a4..cd3e2731be 100644
--- a/src/feature/dirparse/ns_parse.c
+++ b/src/feature/dirparse/ns_parse.c
@@ -434,6 +434,8 @@ routerstatus_parse_entry_from_string(memarea_t *area,
rs->is_possible_guard = 1;
else if (!strcmp(tok->args[i], "BadExit"))
rs->is_bad_exit = 1;
+ else if (!strcmp(tok->args[i], "MiddleOnly"))
+ rs->is_middle_only = 1;
else if (!strcmp(tok->args[i], "Authority"))
rs->is_authority = 1;
else if (!strcmp(tok->args[i], "Unnamed") &&