Control: getinfo entry-guards report down-since

If the guard unreachable_since variable was set, the status "up" was
reported which is wrong. This adds the "down" status followed by the
unreachable_since time value.

Fixes #14184

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
This commit is contained in:
David Goulet 2015-01-28 10:52:14 -05:00
parent e36faeec1d
commit b101f4e98c
2 changed files with 8 additions and 0 deletions

5
changes/bug14184 Normal file
View File

@ -0,0 +1,5 @@
o Minor bugfixes:
- On the control port, the "entry-guards" command was reporting an "up"
status for a relay that was actually down. This fix check if
"unreachable_since" is set and if so reports the "down" status. Fixes
bug 14184.

View File

@ -1666,6 +1666,9 @@ getinfo_helper_entry_guards(control_connection_t *conn,
} else if (e->bad_since) { } else if (e->bad_since) {
when = e->bad_since; when = e->bad_since;
status = "unusable"; status = "unusable";
} else if (e->unreachable_since) {
when = e->unreachable_since;
status = "down";
} else { } else {
status = "up"; status = "up";
} }