aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-05-10 09:13:28 -0400
committerNick Mathewson <nickm@torproject.org>2018-05-10 09:13:28 -0400
commit1eede00a4bd9a7de2acf77393f2fc57aa3196d08 (patch)
tree688cc901746da198c07db0932bfca14de2c22651 /src/or/connection.c
parentbeca6a585c5cd594333ae07b0ae3326188f9d67c (diff)
parent8b4cf7771e869bea4550452ad2cf5634278e0e87 (diff)
downloadtor-1eede00a4bd9a7de2acf77393f2fc57aa3196d08.tar.gz
tor-1eede00a4bd9a7de2acf77393f2fc57aa3196d08.zip
Merge branch 'ticket26063_squashed'
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 1b15260801..3462dbeac2 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1762,13 +1762,13 @@ connection_connect_sockaddr,(connection_t *conn,
tor_assert(sa);
tor_assert(socket_error);
- if (get_options()->DisableNetwork) {
- /* We should never even try to connect anyplace if DisableNetwork is set.
- * Warn if we do, and refuse to make the connection.
+ if (net_is_completely_disabled()) {
+ /* We should never even try to connect anyplace if the network is
+ * completely shut off.
*
- * We only check DisableNetwork here, not we_are_hibernating(), since
- * we'll still try to fulfill client requests sometimes in the latter case
- * (if it is soft hibernation) */
+ * (We don't check net_is_disabled() here, since we still sometimes
+ * want to open connections when we're in soft hibernation.)
+ */
static ratelim_t disablenet_violated = RATELIM_INIT(30*60);
*socket_error = SOCK_ERRNO(ENETUNREACH);
log_fn_ratelim(&disablenet_violated, LOG_WARN, LD_BUG,