[tor-commits] [tor/master] Remove client-side bad directory logic
nickm at torproject.org
nickm at torproject.org
Tue Sep 9 15:54:48 UTC 2014
commit 409a56281eda6e0f39ecb1a2737eb4ab39b0229b
Author: Sebastian Hahn <sebastian at torproject.org>
Date: Fri Sep 5 01:49:47 2014 +0200
Remove client-side bad directory logic
Implements the second half of #13060.
---
changes/bug13060 | 2 ++
src/or/dirserv.c | 3 +--
src/or/networkstatus.c | 1 -
src/or/nodelist.c | 4 +---
src/or/or.h | 4 ----
src/or/routerlist.c | 2 --
src/or/routerparse.c | 2 --
7 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/changes/bug13060 b/changes/bug13060
index 7abc196..58bd2b2 100644
--- a/changes/bug13060
+++ b/changes/bug13060
@@ -1,4 +1,6 @@
o Removed features:
- Directory authorities do not support giving out the BadDirectory
flag anymore.
+ - Clients don't understand the BadDirectory flag in the consensus
+ anymore, and ignore it.
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index d96867b..92d34e2 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -2181,8 +2181,7 @@ clear_status_flags_on_sybil(routerstatus_t *rs)
{
rs->is_authority = rs->is_exit = rs->is_stable = rs->is_fast =
rs->is_flagged_running = rs->is_named = rs->is_valid =
- rs->is_hs_dir = rs->is_possible_guard = rs->is_bad_exit =
- rs->is_bad_directory = 0;
+ rs->is_hs_dir = rs->is_possible_guard = rs->is_bad_exit = 0;
/* FFFF we might want some mechanism to check later on if we
* missed zeroing any flags: it's easy to add a new flag but
* forget to add it to this clause. */
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 220faf0..95eb320 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -1055,7 +1055,6 @@ routerstatus_has_changed(const routerstatus_t *a, const routerstatus_t *b)
a->is_valid != b->is_valid ||
a->is_possible_guard != b->is_possible_guard ||
a->is_bad_exit != b->is_bad_exit ||
- a->is_bad_directory != b->is_bad_directory ||
a->is_hs_dir != b->is_hs_dir ||
a->version_known != b->version_known;
}
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index d7deac1..f37fb49 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -241,7 +241,6 @@ nodelist_set_consensus(networkstatus_t *ns)
node->is_stable = rs->is_stable;
node->is_possible_guard = rs->is_possible_guard;
node->is_exit = rs->is_exit;
- node->is_bad_directory = rs->is_bad_directory;
node->is_bad_exit = rs->is_bad_exit;
node->is_hs_dir = rs->is_hs_dir;
node->ipv6_preferred = 0;
@@ -267,8 +266,7 @@ nodelist_set_consensus(networkstatus_t *ns)
node->is_valid = node->is_running = node->is_hs_dir =
node->is_fast = node->is_stable =
node->is_possible_guard = node->is_exit =
- node->is_bad_exit = node->is_bad_directory =
- node->ipv6_preferred = 0;
+ node->is_bad_exit = node->ipv6_preferred = 0;
}
}
} SMARTLIST_FOREACH_END(node);
diff --git a/src/or/or.h b/src/or/or.h
index 6ef71e9..06d4e3c 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2139,8 +2139,6 @@ typedef struct routerstatus_t {
* choice as an entry guard. */
unsigned int is_bad_exit:1; /**< True iff this node is a bad choice for
* an exit node. */
- unsigned int is_bad_directory:1; /**< Do we think this directory is junky,
- * underpowered, or otherwise useless? */
unsigned int is_hs_dir:1; /**< True iff this router is a v2-or-later hidden
* service directory. */
/** True iff we know version info for this router. (i.e., a "v" entry was
@@ -2300,8 +2298,6 @@ typedef struct node_t {
unsigned int is_exit:1; /**< Do we think this is an OK exit? */
unsigned int is_bad_exit:1; /**< Do we think this exit is censored, borked,
* or otherwise nasty? */
- unsigned int is_bad_directory:1; /**< Do we think this directory is junky,
- * underpowered, or otherwise useless? */
unsigned int is_hs_dir:1; /**< True iff this router is a hidden service
* directory according to the authorities. */
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 14451c0..697837e 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1450,8 +1450,6 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags)
if (!node->is_running || !status->dir_port || !node->is_valid)
continue;
- if (node->is_bad_directory)
- continue;
if (requireother && router_digest_is_me(node->identity))
continue;
is_trusted = router_digest_is_trusted_dir(node->identity);
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 337ba57..281341d 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -1900,8 +1900,6 @@ 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], "BadDirectory"))
- rs->is_bad_directory = 1;
else if (!strcmp(tok->args[i], "Authority"))
rs->is_authority = 1;
else if (!strcmp(tok->args[i], "Unnamed") &&
More information about the tor-commits
mailing list