diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-07-12 16:34:45 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-07-12 16:34:45 +0000 |
commit | 656b7761a81155047af6b41fd27c2aa6663b008e (patch) | |
tree | 1512af7c66de1e3ee6bb9eebbc055272c83e876e | |
parent | 9ed261cd6a75592ffab2259553558fb924e33211 (diff) | |
download | tor-656b7761a81155047af6b41fd27c2aa6663b008e.tar.gz tor-656b7761a81155047af6b41fd27c2aa6663b008e.zip |
r13730@catbus: nickm | 2007-07-12 12:32:40 -0400
Patch from lodger: avoid roundoff-error-induced crash bugs when picking routers by bandwidth.
Also, remove listed backports for 0.1.2.x; that list is now in TODO.012
svn:r10812
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | doc/TODO | 4 | ||||
-rw-r--r-- | src/or/routerlist.c | 6 |
3 files changed, 13 insertions, 7 deletions
@@ -41,6 +41,11 @@ Changes in version 0.2.0.3-alpha - 2007-??-?? - Fix a crash bug when router descriptors end at a 4096-byte boundary on disk. [Bugfix on 0.1.2.x] + o Minor bugfixes (core protocol): + - When sending destroy cells from a circuit's origin, don't include + the reason for tearing down the circuit. The spec says we didn't, + and now we actually don't. Reported by lodger. [Bugfix on 0.1.2.x] + o Minor bugfixes (directory): - Fix another crash bug related to extra-info caching. (Bug found by Peter Palfrader.) [Bugfix on 0.2.0.2-alpha] @@ -75,9 +80,6 @@ Changes in version 0.2.0.3-alpha - 2007-??-?? o Security fixes (BSD natd support): - Fix a possible buffer overrun when using BSD natd support. Bug found by croup. - - When sending destroy cells from a circuit's origin, don't include - the reason for tearing down the circuit. The spec says we didn't, - and now we actually don't. Reported by lodger. [Bugfix on 0.1.2.x] Changes in version 0.2.0.2-alpha - 2007-06-02 @@ -271,6 +273,8 @@ Changes in version 0.2.0.1-alpha - 2007-06-01 we restart. - Add even more asserts to hunt down bug 417. - Build without verbose warnings even on (not-yet-released) gcc 4.2. + - Fix a possible (but very unlikely) bug in picking routers by bandwidth. + Add a log message to confirm that it is in fact unlikely. o Minor bugfixes (controller): - Make 'getinfo fingerprint' return a 551 error if we're not a @@ -15,10 +15,6 @@ P - phobos claims Documentation and testing on 0.1.2.x-final series - - Pending backports for 0.1.2.x: - - r10148: Open cached-routers with FILE_SHARE_READ on win32. - - r10493: Weight guard selection by bandwidth. - N - Test guard unreachable logic; make sure that we actually attempt to connect to guards that we think are unreachable from time to time. Make sure that we don't freak out when the network is down. diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 39da0bd0b6..944245d140 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -1294,6 +1294,12 @@ smartlist_choose_by_bandwidth(smartlist_t *sl, int for_exit, int statuses) if (tmp >= rand_bw) break; } + if (i == smartlist_len(sl)) { + /* This is possible due to round-off error. */ + --i; + log_warn(LD_BUG, "Round-off error in computing bandwidth had an effect on " + " which router we chose. Please tell the developers."); + } tor_free(bandwidths); return smartlist_get(sl, i); } |