diff options
author | teor <teor@torproject.org> | 2019-03-20 09:47:31 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-03-20 09:47:31 +1000 |
commit | 6bf9078cebad2d993c4b82b15b668ddcb26fa948 (patch) | |
tree | 899cf7bfbf91b2394d28b758b7c2adb626c2127d | |
parent | 17e3eea68538f81a1375009fa6881ad89e11d5db (diff) | |
parent | 532f4c9103315bff1de21b3e0eeeee6fcf790647 (diff) | |
download | tor-6bf9078cebad2d993c4b82b15b668ddcb26fa948.tar.gz tor-6bf9078cebad2d993c4b82b15b668ddcb26fa948.zip |
Merge remote-tracking branch 'tor-github/pr/798' into maint-0.3.5
-rw-r--r-- | changes/bug28656 | 3 | ||||
-rw-r--r-- | src/feature/nodelist/nodelist.c | 16 |
2 files changed, 14 insertions, 5 deletions
diff --git a/changes/bug28656 b/changes/bug28656 new file mode 100644 index 0000000000..d3a13d196c --- /dev/null +++ b/changes/bug28656 @@ -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. diff --git a/src/feature/nodelist/nodelist.c b/src/feature/nodelist/nodelist.c index 935ac78403..99d7f746a8 100644 --- a/src/feature/nodelist/nodelist.c +++ b/src/feature/nodelist/nodelist.c @@ -2449,12 +2449,18 @@ compute_frac_paths_available(const networkstatus_t *consensus, f_exit = f_myexit; } - /* if the consensus has no exits, we can only build onion service paths, - * which are G - M - M. So use the middle fraction for the exit fraction. */ + /* If the consensus has no exits that pass flag, descriptor, and policy + * checks, we can only build onion service paths, which are G - M - M. */ if (router_have_consensus_path() != CONSENSUS_PATH_EXIT) { - /* If there are no exits in the consensus, then f_exit is always 0, so - * it is safe to replace f_exit with f_mid. */ - if (!BUG(f_exit > 0.0)) { + /* If the exit bandwidth weight fraction is not zero, we need to wait for + * descriptors for those exits. (The bandwidth weight fraction does not + * 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; } } |