]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
chan: Use channel_is_client() in channel_do_open_actions()
authorDavid Goulet <dgoulet@torproject.org>
Fri, 23 Mar 2018 14:11:37 +0000 (10:11 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Fri, 23 Mar 2018 14:11:37 +0000 (10:11 -0400)
Make sure we actually only report client channel to the geoip cache instead of
looking if it is a known relay. Looking if it is a known relay can be
unreliable because they come and go from the consensus.

Fixes #24904

Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/bug24904 [new file with mode: 0644]
src/or/channel.c

diff --git a/changes/bug24904 b/changes/bug24904
new file mode 100644 (file)
index 0000000..648d9a5
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfix (channel, client):
+    - Better identify client connection when reporting to the geoip client
+      cache. Fixes bug 24904; bugfix on 0.3.1.7.
+
index ff1cfde2adbb71eeeecd32087763e5ea8d29a747..a4740dd752a58bb33a84534513a29fa5a77f7082 100644 (file)
@@ -1849,8 +1849,8 @@ channel_do_open_actions(channel_t *chan)
     circuit_build_times_network_is_live(get_circuit_build_times_mutable());
     router_set_status(chan->identity_digest, 1);
   } else {
-    /* only report it to the geoip module if it's not a known router */
-    if (!connection_or_digest_is_known_relay(chan->identity_digest)) {
+    /* only report it to the geoip module if it's a client */
+    if (channel_is_client(chan)) {
       if (channel_get_addr_if_possible(chan, &remote_addr)) {
         char *transport_name = NULL;
         channel_tls_t *tlschan = BASE_CHAN_TO_TLS(chan);