]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Stop clearing the is_client flag on channel directly
authorNick Mathewson <nickm@torproject.org>
Wed, 6 Sep 2017 18:55:58 +0000 (14:55 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 22 Sep 2017 12:55:53 +0000 (08:55 -0400)
src/or/channel.c
src/or/channel.h
src/or/command.c

index 9f8a03683f08acd982871a3244891848271a2a0e..ea113903afa2ce7e59a9aaca3ae7e7b5d8ba8d32 100644 (file)
@@ -4096,6 +4096,20 @@ channel_mark_client(channel_t *chan)
   chan->is_client = 1;
 }
 
+/**
+ * Clear the client flag
+ *
+ * Mark a channel as being _not_ from a client
+ */
+
+void
+channel_clear_client(channel_t *chan)
+{
+  tor_assert(chan);
+
+  chan->is_client = 0;
+}
+
 /**
  * Get the canonical flag for a channel
  *
index 2d0ec3992437896a8df9da32c433c22f61d81235..a5a87de1367b8385cfc085c25251014fd0ff33a7 100644 (file)
@@ -671,6 +671,7 @@ int channel_is_local(channel_t *chan);
 int channel_is_incoming(channel_t *chan);
 int channel_is_outgoing(channel_t *chan);
 void channel_mark_client(channel_t *chan);
+void channel_clear_client(channel_t *chan);
 int channel_matches_extend_info(channel_t *chan, extend_info_t *extend_info);
 int channel_matches_target_addr_for_extend(channel_t *chan,
                                            const tor_addr_t *target);
index 2c82984901bb437d1c092fcf55fc7fa5ff03221d..46d3b6291c7be16dc4f5a8d71e96be11aee426fa 100644 (file)
@@ -331,7 +331,7 @@ command_process_create_cell(cell_t *cell, channel_t *chan)
     // Needed for chutney: Sometimes relays aren't in the consensus yet, and
     // get marked as clients. This resets their channels once they appear.
     // Probably useful for normal operation wrt relay flapping, too.
-    chan->is_client = 0;
+    channel_clear_client(chan);
   } else {
     channel_mark_client(chan);
   }