summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-09-06 15:37:09 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-22 08:55:53 -0400
commitceb49c1c5f2556c7fcd5b1ff34d8988344fa2ba7 (patch)
tree6a960f9deb6f84284dbbb97daa16de8742da69d1
parentd1e0e486e9eafa7ba44e3ed49ce1b92fec9c7201 (diff)
downloadtor-ceb49c1c5f2556c7fcd5b1ff34d8988344fa2ba7.tar.gz
tor-ceb49c1c5f2556c7fcd5b1ff34d8988344fa2ba7.zip
Use channel_is_client() accessor in channelpadding.c.
Also, allow channel_is_client() to take a const channel.
-rw-r--r--src/or/channel.c2
-rw-r--r--src/or/channel.h2
-rw-r--r--src/or/channelpadding.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/or/channel.c b/src/or/channel.c
index ea113903af..fa704e0426 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -4075,7 +4075,7 @@ channel_mark_bad_for_new_circs(channel_t *chan)
*/
int
-channel_is_client(channel_t *chan)
+channel_is_client(const channel_t *chan)
{
tor_assert(chan);
diff --git a/src/or/channel.h b/src/or/channel.h
index a5a87de136..e913e9749e 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -666,7 +666,7 @@ int channel_is_bad_for_new_circs(channel_t *chan);
void channel_mark_bad_for_new_circs(channel_t *chan);
int channel_is_canonical(channel_t *chan);
int channel_is_canonical_is_reliable(channel_t *chan);
-int channel_is_client(channel_t *chan);
+int channel_is_client(const channel_t *chan);
int channel_is_local(channel_t *chan);
int channel_is_incoming(channel_t *chan);
int channel_is_outgoing(channel_t *chan);
diff --git a/src/or/channelpadding.c b/src/or/channelpadding.c
index bed2489837..2122602ffd 100644
--- a/src/or/channelpadding.c
+++ b/src/or/channelpadding.c
@@ -66,7 +66,7 @@ static int consensus_nf_pad_relays;
* its a client, use that. Then finally verify in the consensus).
*/
#define CHANNEL_IS_CLIENT(chan, options) \
- (!public_server_mode((options)) || (chan)->is_client || \
+ (!public_server_mode((options)) || channel_is_client(chan) || \
!connection_or_digest_is_known_relay((chan)->identity_digest))
/**