diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-05-08 14:12:29 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-05-08 14:12:29 -0400 |
commit | 5edc72a45b7479f5fe791054aa19f6b3b478c725 (patch) | |
tree | 9d950f8c59ca8a57884be821f4eab4775125f087 /src/or/entrynodes.c | |
parent | 2a4439adf37ed75c8f7d2db3134d0263f70de796 (diff) | |
parent | e716c92127f0da2fc5758c091a9e33857cd5e5d5 (diff) | |
download | tor-5edc72a45b7479f5fe791054aa19f6b3b478c725.tar.gz tor-5edc72a45b7479f5fe791054aa19f6b3b478c725.zip |
Merge remote-tracking branch 'mikeperry/bug25870_rebase'
Diffstat (limited to 'src/or/entrynodes.c')
-rw-r--r-- | src/or/entrynodes.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c index bc2afb142a..27d760f1a8 100644 --- a/src/or/entrynodes.c +++ b/src/or/entrynodes.c @@ -118,6 +118,7 @@ #include "circpathbias.h" #include "circuitbuild.h" #include "circuitlist.h" +#include "circuituse.h" #include "circuitstats.h" #include "config.h" #include "confparse.h" @@ -3479,12 +3480,18 @@ guards_update_all(void) used. */ const node_t * guards_choose_guard(cpath_build_state_t *state, - circuit_guard_state_t **guard_state_out) + uint8_t purpose, + circuit_guard_state_t **guard_state_out) { const node_t *r = NULL; const uint8_t *exit_id = NULL; entry_guard_restriction_t *rst = NULL; - if (state && (exit_id = build_state_get_exit_rsa_id(state))) { + + /* Only apply restrictions if we have a specific exit node in mind, and only + * if we are not doing vanguard circuits: we don't want to apply guard + * restrictions to vanguard circuits. */ + if (state && !circuit_should_use_vanguards(purpose) && + (exit_id = build_state_get_exit_rsa_id(state))) { /* We're building to a targeted exit node, so that node can't be * chosen as our guard for this circuit. Remember that fact in a * restriction. */ |