diff options
author | Roger Dingledine <arma@torproject.org> | 2012-01-25 18:54:59 -0500 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2012-01-25 18:54:59 -0500 |
commit | a0f0897795c45d22ad2d2dde98c81195a9db24dc (patch) | |
tree | 715f4ce9819073bca879b40f01c7030a7b4bc603 /src/or/directory.c | |
parent | 247a21379af1cf90896d9818cf448d9687f6277c (diff) | |
download | tor-a0f0897795c45d22ad2d2dde98c81195a9db24dc.tar.gz tor-a0f0897795c45d22ad2d2dde98c81195a9db24dc.zip |
Allow 0.2.3.x clients to use 0.2.2.x bridges.
Previously the client would ask the bridge for microdescriptors, which are
only supported in 0.2.3.x and later, and then fail to bootstrap when it
didn't get the answers it wanted. Fixes bug 4013; bugfix on 0.2.3.2-alpha.
The fix here is to revert to using normal descriptors if any of our
bridges are known to not support microdescs. This is not ideal, a) because
we'll start downloading a microdesc consensus as soon as we get a bridge
descriptor, and that will waste time if we later get a bridge descriptor
that tells us we don't like microdescriptors; and b) by changing our mind
we're leaking to our other bridges that we have an old-version bridge.
The alternate fix would have been to change
we_use_microdescriptors_for_circuits() to ask if *any* of our bridges
can support microdescriptors, and then change the directory logic that
picks a bridge to only select from those that do. For people living in
the future, where 0.2.2.x is obsolete, there won't be a difference.
Note that in either of these potential fixes, we have risk of oscillation
if our one funny-looking bridges goes away / comes back.
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 149e692f07..c6a527cb3c 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -421,11 +421,15 @@ directory_get_from_dirserver(uint8_t dir_purpose, uint8_t router_purpose, if (!get_via_tor) { if (options->UseBridges && type != BRIDGE_DIRINFO) { - /* want to ask a running bridge for which we have a descriptor. */ - /* XXX023 we assume that all of our bridges can answer any - * possible directory question. This won't be true forever. -RD */ - /* It certainly is not true with conditional consensus downloading, - * so, for now, never assume the server supports that. */ + /* We want to ask a running bridge for which we have a descriptor. + * + * Be careful here: we should only ask questions that we know our + * bridges can answer. So far we're solving that by backing off to + * the behavior supported by our oldest bridge; see for example + * any_bridges_dont_support_microdescriptors(). + */ + /* XXX024 Not all bridges handle conditional consensus downloading, + * so, for now, never assume the server supports that. -PP */ const node_t *node = choose_random_entry(NULL); if (node && node->ri) { /* every bridge has a routerinfo. */ |