Stop logging a BUG() warning when tor is waiting for exit descriptors

Fixes bug 28656; bugfix on 0.3.5.1-alpha.
This commit is contained in:
teor 2019-03-05 12:53:14 +10:00 committed by Nick Mathewson
parent 1c248fa27d
commit 532f4c9103
2 changed files with 14 additions and 5 deletions

3
changes/bug28656 Normal file
View File

@ -0,0 +1,3 @@
o Minor bugfixes (logging):
- Stop logging a BUG() warning when tor is waiting for exit descriptors.
Fixes bug 28656; bugfix on 0.3.5.1-alpha.

View File

@ -2449,12 +2449,18 @@ compute_frac_paths_available(const networkstatus_t *consensus,
f_exit = f_myexit; f_exit = f_myexit;
} }
/* if the consensus has no exits, we can only build onion service paths, /* If the consensus has no exits that pass flag, descriptor, and policy
* which are G - M - M. So use the middle fraction for the exit fraction. */ * checks, we can only build onion service paths, which are G - M - M. */
if (router_have_consensus_path() != CONSENSUS_PATH_EXIT) { if (router_have_consensus_path() != CONSENSUS_PATH_EXIT) {
/* If there are no exits in the consensus, then f_exit is always 0, so /* If the exit bandwidth weight fraction is not zero, we need to wait for
* it is safe to replace f_exit with f_mid. */ * descriptors for those exits. (The bandwidth weight fraction does not
if (!BUG(f_exit > 0.0)) { * check for descriptors.)
* If the exit bandwidth fraction is zero, there are no exits in the
* consensus at all. So it is safe to replace f_exit with f_mid.
*
* f_exit is non-negative, but some compilers complain about float and ==
*/
if (f_exit <= 0.0) {
f_exit = f_mid; f_exit = f_mid;
} }
} }