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/microdesc.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/microdesc.c')
-rw-r--r-- | src/or/microdesc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/microdesc.c b/src/or/microdesc.c index 0a1ae91cce..be9b99759c 100644 --- a/src/or/microdesc.c +++ b/src/or/microdesc.c @@ -2,6 +2,7 @@ /* See LICENSE for licensing information */ #include "or.h" +#include "circuitbuild.h" #include "config.h" #include "directory.h" #include "dirserv.h" @@ -720,8 +721,14 @@ we_use_microdescriptors_for_circuits(const or_options_t *options) int ret = options->UseMicrodescriptors; if (ret == -1) { /* UseMicrodescriptors is "auto"; we need to decide: */ - /* So we decide that we'll use microdescriptors iff we are not a server, - * and we're not autofetching everything. */ + /* If we are configured to use bridges and one of our bridges doesn't + * know what a microdescriptor is, the answer is no. */ + if (options->UseBridges && any_bridges_dont_support_microdescriptors()) + return 0; + /* Otherwise, we decide that we'll use microdescriptors iff we are + * not a server, and we're not autofetching everything. */ + /* XXX023 what does not being a server have to do with it? also there's + * a partitioning issue here where bridges differ from clients. */ ret = !server_mode(options) && !options->FetchUselessDescriptors; } return ret; |