From f6b1dc2805ce23d4f7fddcf2714b13f718d20038 Mon Sep 17 00:00:00 2001 From: Sebastian Hahn Date: Fri, 28 Oct 2011 11:19:16 +0200 Subject: [PATCH 1/4] Fix typo, spotted by tmpname0901. Thanks! --- changes/bug4331 | 4 ++++ src/or/hibernate.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changes/bug4331 diff --git a/changes/bug4331 b/changes/bug4331 new file mode 100644 index 0000000000..011238a962 --- /dev/null +++ b/changes/bug4331 @@ -0,0 +1,4 @@ + o Trivial fixes: + - Fixed a typo in a hibernation-related log message. Fixes bug 4331; + bugfix on 0.2.2.23-alpha; found by "tmpname0901". + diff --git a/src/or/hibernate.c b/src/or/hibernate.c index aebce4cc88..2f7170fa24 100644 --- a/src/or/hibernate.c +++ b/src/or/hibernate.c @@ -943,7 +943,7 @@ consider_hibernation(time_t now) if (hibernate_soft_limit_reached()) { log_notice(LD_ACCT, "Bandwidth soft limit reached; commencing hibernation. " - "No new conncetions will be accepted"); + "No new connections will be accepted"); hibernate_begin(HIBERNATE_STATE_LOWBANDWIDTH, now); } else if (accounting_enabled && now < interval_wakeup_time) { format_local_iso_time(buf,interval_wakeup_time); From cf8bffa35901a26ae840dcd715dd2f664259efb3 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 28 Oct 2011 17:04:15 -0400 Subject: [PATCH 2/4] Discard all cells on a marked connection Fix for bug 4299 --- changes/bug4299 | 5 +++++ src/or/command.c | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 changes/bug4299 diff --git a/changes/bug4299 b/changes/bug4299 new file mode 100644 index 0000000000..c43d81460a --- /dev/null +++ b/changes/bug4299 @@ -0,0 +1,5 @@ + o Major bugfix: + - Do not process cells on a marked-for-close connection. We previously + avoided this by not calling read handlers on marked connections, but + that's not adequate for the case when cells are very small. Fixes + bug 4299; bugfix on 0.2.0.20-rc which first made small cells possible. diff --git a/src/or/command.c b/src/or/command.c index 1fa8bc6a7e..5271a7a907 100644 --- a/src/or/command.c +++ b/src/or/command.c @@ -132,6 +132,9 @@ command_process_cell(cell_t *cell, or_connection_t *conn) #define PROCESS_CELL(tp, cl, cn) command_process_ ## tp ## _cell(cl, cn) #endif + if (conn->_base.marked_for_close) + return; + /* Reject all but VERSIONS and NETINFO when handshaking. */ if (handshaking && cell->command != CELL_VERSIONS && cell->command != CELL_NETINFO) @@ -205,6 +208,9 @@ command_process_var_cell(var_cell_t *cell, or_connection_t *conn) } #endif + if (conn->_base.marked_for_close) + return; + /* reject all when not handshaking. */ if (conn->_base.state != OR_CONN_STATE_OR_HANDSHAKING) return; From dfdb4fde1acbec20b5dedd91005dcf64c730c411 Mon Sep 17 00:00:00 2001 From: Sebastian Hahn Date: Wed, 22 Dec 2010 08:34:41 +0100 Subject: [PATCH 3/4] Disable stats requiring geoip info if we have none In other parts of the code we will otherwise attempt to collect these statistics, and that will lead to crashes. --- src/or/config.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/or/config.c b/src/or/config.c index 78e433620d..ca4e71cccd 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1425,6 +1425,7 @@ options_act(or_options_t *old_options) geoip_dirreq_stats_init(now); print_notice = 1; } else { + options->DirReqStatistics = 0; log_notice(LD_CONFIG, "Configured to measure directory request " "statistics, but no GeoIP database found! " "Please specify a GeoIP database using the " @@ -1437,6 +1438,7 @@ options_act(or_options_t *old_options) geoip_entry_stats_init(now); print_notice = 1; } else { + options->EntryStatistics = 0; log_notice(LD_CONFIG, "Configured to measure entry node " "statistics, but no GeoIP database found! " "Please specify a GeoIP database using the " From c5c5f859d37bc46f912cca9ba0fa0e1300062e40 Mon Sep 17 00:00:00 2001 From: Sebastian Hahn Date: Sat, 29 Oct 2011 11:21:37 +0200 Subject: [PATCH 4/4] Add a changes file for the 4340 fix --- changes/bug4340 | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changes/bug4340 diff --git a/changes/bug4340 b/changes/bug4340 new file mode 100644 index 0000000000..08098b1cd5 --- /dev/null +++ b/changes/bug4340 @@ -0,0 +1,5 @@ + o Major bugfixes: + - Don't crash when we're running as a relay and don't have a geoip + file. Bugfix on tor-0.2.2.34; fixes bug 4340. This backports a fix + we've had in master already. +