diff options
author | teor <teor2345@gmail.com> | 2014-10-01 19:04:04 +1000 |
---|---|---|
committer | teor <teor2345@gmail.com> | 2014-10-08 05:37:15 +1100 |
commit | 31bf8f26907945b8f26a7543e42ce0e92dd4918f (patch) | |
tree | 84d0c184ee9a4714690ed87de352f7141c0afdcc /src/or/directory.c | |
parent | ff42222845f5d79f27b653990cab4f20ad91a068 (diff) | |
download | tor-31bf8f26907945b8f26a7543e42ce0e92dd4918f.tar.gz tor-31bf8f26907945b8f26a7543e42ce0e92dd4918f.zip |
Bitwise check BRIDGE_DIRINFO
Bitwise check for the BRIDGE_DIRINFO flag, rather than checking for
equality.
Fixes a (potential) bug where directories offering BRIDGE_DIRINFO,
and some other flag (i.e. microdescriptors or extrainfo),
would be ignored when looking for bridge directories.
Final fix in series for bug 13163.
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 12717ebfed..83cc56f352 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -452,7 +452,7 @@ directory_get_from_dirserver(uint8_t dir_purpose, uint8_t router_purpose, return; if (!get_via_tor) { - if (options->UseBridges && type != BRIDGE_DIRINFO) { + if (options->UseBridges && !(type & BRIDGE_DIRINFO)) { /* We want to ask a running bridge for which we have a descriptor. * * When we ask choose_random_entry() for a bridge, we specify what @@ -479,7 +479,7 @@ directory_get_from_dirserver(uint8_t dir_purpose, uint8_t router_purpose, "nodes are available yet."); return; } else { - if (prefer_authority || type == BRIDGE_DIRINFO) { + if (prefer_authority || (type & BRIDGE_DIRINFO)) { /* only ask authdirservers, and don't ask myself */ rs = router_pick_trusteddirserver(type, pds_flags); if (rs == NULL && (pds_flags & (PDS_NO_EXISTING_SERVERDESC_FETCH| @@ -506,7 +506,7 @@ directory_get_from_dirserver(uint8_t dir_purpose, uint8_t router_purpose, return; } } - if (!rs && type != BRIDGE_DIRINFO) { + if (!rs && !(type & BRIDGE_DIRINFO)) { /* */ rs = directory_pick_generic_dirserver(type, pds_flags, dir_purpose); |