diff --git a/changes/bug13221 b/changes/bug13221 new file mode 100644 index 0000000000..13935a1921 --- /dev/null +++ b/changes/bug13221 @@ -0,0 +1,5 @@ + o Minor bugfixes (logging): + - Correct a misleading error message when IPv4Only or IPv6Only + is used but the resolved address can not be interpreted as an + address of the specified IP version. Fixes bug 13221; bugfix + on 0.2.3.9-alpha. Patch from Kris Katterjohn. diff --git a/changes/bug27199 b/changes/bug27199 new file mode 100644 index 0000000000..f9d2a422f9 --- /dev/null +++ b/changes/bug27199 @@ -0,0 +1,3 @@ + o Minor bugfixes (rust): + - Abort on panic in all build profiles, instead of potentially unwinding + into C code. Fixes bug 27199; bugfix on 0.3.3.1-alpha. diff --git a/changes/bug28698 b/changes/bug28698 new file mode 100644 index 0000000000..716aa0c552 --- /dev/null +++ b/changes/bug28698 @@ -0,0 +1,3 @@ + o Minor bugfix (logging): + - Avoid logging about relaxing circuits when their time is fixed. + Fixes bug 28698; bugfix on 0.2.4.7-alpha diff --git a/changes/bug29017 b/changes/bug29017 new file mode 100644 index 0000000000..5c4a53c43f --- /dev/null +++ b/changes/bug29017 @@ -0,0 +1,4 @@ + o Minor bugfixes (stats): + - When ExtraInfoStatistics is 0, stop including PaddingStatistics in + relay and bridge extra-info documents. Fixes bug 29017; + bugfix on 0.3.1.1-alpha. diff --git a/changes/bug29144 b/changes/bug29144 new file mode 100644 index 0000000000..5801224f14 --- /dev/null +++ b/changes/bug29144 @@ -0,0 +1,5 @@ + o Minor bugfixes (logging): + - Log the correct port number for listening sockets when "auto" is + used to let Tor pick the port number. Previously, port 0 was + logged instead of the actual port number. Fixes bug 29144; + bugfix on 0.3.5.1-alpha. Patch from Kris Katterjohn. diff --git a/changes/bug29665 b/changes/bug29665 new file mode 100644 index 0000000000..d89046faf5 --- /dev/null +++ b/changes/bug29665 @@ -0,0 +1,7 @@ + o Minor bugfixes (single onion services): + - Allow connections to single onion services to remain idle without + being disconnected. Relays acting as rendezvous points for + single onion services were mistakenly closing idle established + rendezvous circuits after 60 seconds, thinking that they are unused + directory-fetching circuits that had served their purpose. Fixes + bug 29665; bugfix on 0.2.1.26. diff --git a/doc/tor.1.txt b/doc/tor.1.txt index 573fdf221a..975a198182 100644 --- a/doc/tor.1.txt +++ b/doc/tor.1.txt @@ -2279,7 +2279,7 @@ is non-zero): extra-info document. (Default: 0) [[PaddingStatistics]] **PaddingStatistics** **0**|**1**:: - Relays only. + Relays and bridges only. When this option is enabled, Tor collects statistics for padding cells sent and received by this relay, in addition to total cell counts. These statistics are rounded, and omitted if traffic is low. This diff --git a/src/app/config/config.c b/src/app/config/config.c index e06c77e439..2a504d3065 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -7061,13 +7061,13 @@ parse_port_config(smartlist_t *out, portname, escaped(ports->value)); goto err; } - if (bind_ipv4_only && tor_addr_family(&addr) == AF_INET6) { - log_warn(LD_CONFIG, "Could not interpret %sPort address as IPv6", + if (bind_ipv4_only && tor_addr_family(&addr) != AF_INET) { + log_warn(LD_CONFIG, "Could not interpret %sPort address as IPv4", portname); goto err; } - if (bind_ipv6_only && tor_addr_family(&addr) == AF_INET) { - log_warn(LD_CONFIG, "Could not interpret %sPort address as IPv4", + if (bind_ipv6_only && tor_addr_family(&addr) != AF_INET6) { + log_warn(LD_CONFIG, "Could not interpret %sPort address as IPv6", portname); goto err; } diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c index f2a646c5f9..7b8dc7f364 100644 --- a/src/core/mainloop/connection.c +++ b/src/core/mainloop/connection.c @@ -1527,7 +1527,7 @@ connection_listener_new(const struct sockaddr *listensockaddr, conn_type_to_string(type), conn->address); } else { log_notice(LD_NET, "Opened %s on %s", - conn_type_to_string(type), fmt_addrport(&addr, usePort)); + conn_type_to_string(type), fmt_addrport(&addr, gotPort)); } return conn; diff --git a/src/core/or/circuituse.c b/src/core/or/circuituse.c index 8918dd077e..02bfa15fb3 100644 --- a/src/core/or/circuituse.c +++ b/src/core/or/circuituse.c @@ -545,6 +545,8 @@ circuit_expire_building(void) SMARTLIST_FOREACH_BEGIN(circuit_get_global_list(), circuit_t *,victim) { struct timeval cutoff; + bool fixed_time = circuit_build_times_disabled(get_options()); + if (!CIRCUIT_IS_ORIGIN(victim) || /* didn't originate here */ victim->marked_for_close) /* don't mess with marked circs */ continue; @@ -599,17 +601,19 @@ circuit_expire_building(void) if (!TO_ORIGIN_CIRCUIT(victim)->relaxed_timeout) { int first_hop_succeeded = TO_ORIGIN_CIRCUIT(victim)->cpath->state == CPATH_STATE_OPEN; - log_info(LD_CIRC, - "No circuits are opened. Relaxing timeout for circuit %d " - "(a %s %d-hop circuit in state %s with channel state %s).", - TO_ORIGIN_CIRCUIT(victim)->global_identifier, - circuit_purpose_to_string(victim->purpose), - TO_ORIGIN_CIRCUIT(victim)->build_state ? - TO_ORIGIN_CIRCUIT(victim)->build_state->desired_path_len : - -1, - circuit_state_to_string(victim->state), - victim->n_chan ? - channel_state_to_string(victim->n_chan->state) : "none"); + if (!fixed_time) { + log_info(LD_CIRC, + "No circuits are opened. Relaxing timeout for circuit %d " + "(a %s %d-hop circuit in state %s with channel state %s).", + TO_ORIGIN_CIRCUIT(victim)->global_identifier, + circuit_purpose_to_string(victim->purpose), + TO_ORIGIN_CIRCUIT(victim)->build_state ? + TO_ORIGIN_CIRCUIT(victim)->build_state->desired_path_len : + -1, + circuit_state_to_string(victim->state), + victim->n_chan ? + channel_state_to_string(victim->n_chan->state) : "none"); + } /* We count the timeout here for CBT, because technically this * was a timeout, and the timeout value needs to reset if we @@ -623,7 +627,8 @@ circuit_expire_building(void) } else { static ratelim_t relax_timeout_limit = RATELIM_INIT(3600); const double build_close_ms = get_circuit_build_close_time_ms(); - log_fn_ratelim(&relax_timeout_limit, LOG_NOTICE, LD_CIRC, + if (!fixed_time) { + log_fn_ratelim(&relax_timeout_limit, LOG_NOTICE, LD_CIRC, "No circuits are opened. Relaxed timeout for circuit %d " "(a %s %d-hop circuit in state %s with channel state %s) to " "%ldms. However, it appears the circuit has timed out " @@ -637,6 +642,7 @@ circuit_expire_building(void) victim->n_chan ? channel_state_to_string(victim->n_chan->state) : "none", (long)build_close_ms); + } } } @@ -1564,10 +1570,14 @@ circuit_expire_old_circuits_serverside(time_t now) or_circ = TO_OR_CIRCUIT(circ); /* If the circuit has been idle for too long, and there are no streams * on it, and it ends here, and it used a create_fast, mark it for close. + * + * Also if there is a rend_splice on it, it's a single onion service + * circuit and we should not close it. */ if (or_circ->p_chan && channel_is_client(or_circ->p_chan) && !circ->n_chan && !or_circ->n_streams && !or_circ->resolving_streams && + !or_circ->rend_splice && channel_when_last_xmit(or_circ->p_chan) <= cutoff) { log_info(LD_CIRC, "Closing circ_id %u (empty %d secs ago)", (unsigned)or_circ->p_circ_id, diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c index b376046c8d..dad2c6a50f 100644 --- a/src/feature/relay/router.c +++ b/src/feature/relay/router.c @@ -2936,12 +2936,11 @@ extrainfo_dump_to_string(char **s_out, extrainfo_t *extrainfo, "conn-bi-direct", now, &contents) > 0) { smartlist_add(chunks, contents); } - } - - if (options->PaddingStatistics) { - contents = rep_hist_get_padding_count_lines(); - if (contents) - smartlist_add(chunks, contents); + if (options->PaddingStatistics) { + contents = rep_hist_get_padding_count_lines(); + if (contents) + smartlist_add(chunks, contents); + } } /* Add information about the pluggable transports we support. */ diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml index 83f9629660..de8693ea33 100644 --- a/src/rust/Cargo.toml +++ b/src/rust/Cargo.toml @@ -10,6 +10,17 @@ members = [ "tor_util", ] +# Can remove panic="abort" when this issue is fixed: +# https://github.com/rust-lang/rust/issues/52652 +[profile.dev] +panic = "abort" + [profile.release] debug = true panic = "abort" + +[profile.test] +panic = "abort" + +[profile.bench] +panic = "abort"