diff options
author | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-01-22 17:43:24 +1100 |
---|---|---|
committer | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-01-29 07:16:32 +1100 |
commit | 1401117ff2bc5fc90df51d19c3c0d7abc439c34e (patch) | |
tree | 52cabe50fe0e4cf65666de7c3324968f767a2db7 /src/or/circuituse.c | |
parent | 77a9de0d48e61e6762e65f6099c9a424544eb0ad (diff) | |
download | tor-1401117ff2bc5fc90df51d19c3c0d7abc439c34e.tar.gz tor-1401117ff2bc5fc90df51d19c3c0d7abc439c34e.zip |
Return NULL from extend_info_from_node if the node has no allowed address
Modify callers to correctly handle these new NULL returns:
* fix assert in onion_extend_cpath
* warn and discard circuit in circuit_get_open_circ_or_launch
* warn, discard circuit, and tell controller in handle_control_extendcircuit
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r-- | src/or/circuituse.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c index e742a5614f..4831f2be76 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -2006,8 +2006,13 @@ circuit_get_open_circ_or_launch(entry_connection_t *conn, if (r && node_has_descriptor(r)) { /* We might want to connect to an IPv6 bridge for loading descriptors so we use the preferred address rather than - the primary. */ + the primary. */ extend_info = extend_info_from_node(r, conn->want_onehop ? 1 : 0); + if (!extend_info) { + log_warn(LD_CIRC,"Could not make a one-hop connection to %s. " + "Discarding this circuit.", conn->chosen_exit_name); + return -1; + } } else { log_debug(LD_DIR, "considering %d, %s", want_onehop, conn->chosen_exit_name); |