summaryrefslogtreecommitdiff
path: root/src/or/channel.c
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@torproject.org>2014-09-05 11:08:46 -0700
committerAndrea Shepard <andrea@torproject.org>2014-09-05 11:12:08 -0700
commit39a017809b6e7f8f779cfa0b4ebea3c0209bef0c (patch)
treef8c9334acf8e44c59204d871b353a32b0601a7be /src/or/channel.c
parentdcb4ee5b83b69234ef8fd0fce8533ab1c4434bd9 (diff)
downloadtor-39a017809b6e7f8f779cfa0b4ebea3c0209bef0c.tar.gz
tor-39a017809b6e7f8f779cfa0b4ebea3c0209bef0c.zip
Correctly update channel local mark when address of incoming connection changes after handshake; fixes bug #12160
Diffstat (limited to 'src/or/channel.c')
-rw-r--r--src/or/channel.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/or/channel.c b/src/or/channel.c
index ffd68493d0..b2b670e4fb 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -3760,6 +3760,23 @@ channel_mark_local(channel_t *chan)
}
/**
+ * Mark a channel as remote
+ *
+ * This internal-only function should be called by the lower layer if the
+ * channel is not to a local address but has previously been marked local.
+ * See channel_is_local() above or the description of the is_local bit in
+ * channel.h
+ */
+
+void
+channel_mark_remote(channel_t *chan)
+{
+ tor_assert(chan);
+
+ chan->is_local = 0;
+}
+
+/**
* Test outgoing flag
*
* This function gets the outgoing flag; this is the inverse of the incoming