]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge branch 'ticket40081_035' into ticket40081_044
authorNick Mathewson <nickm@torproject.org>
Mon, 3 Aug 2020 15:49:09 +0000 (11:49 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 3 Aug 2020 15:49:09 +0000 (11:49 -0400)
Resolves conflicts:
src/core/or/channel.c
        src/test/test_channel.c

1  2 
src/core/or/channel.c
src/core/or/channel.h
src/core/or/channeltls.c
src/core/or/circuitbuild.c
src/test/test_channel.c

index 09986df404430e7fb4f2faa8670baa4caef045f3,b3a2d7122b4c23a31ada0ed3b229bce1f8e21c02..5ed6bb92720c0123a26ed948605b642e08ca34a3
@@@ -784,13 -771,10 +784,12 @@@ channel_check_for_duplicates(void
  
        connections_to_relay++;
        total_relay_connections++;
 +      if (is_dirauth)
 +        total_dirauth_connections++;
  
-       if (chan->is_canonical(chan, 0)) total_canonical++;
+       if (chan->is_canonical(chan)) total_canonical++;
  
-       if (!chan->is_canonical_to_peer && chan->is_canonical(chan, 0)
-           && chan->is_canonical(chan, 1)) {
+       if (!chan->is_canonical_to_peer && chan->is_canonical(chan)) {
          total_half_canonical++;
        }
      }
@@@ -2457,21 -2430,10 +2456,9 @@@ channel_get_for_extend,(const char *rsa
        continue;
      }
  
-     /* If the connection is using a recent link protocol, only return canonical
-      * connections, when the address is one of the addresses we wanted.
-      *
-      * The channel_is_canonical_is_reliable() function asks the lower layer
-      * if we should trust channel_is_canonical(). It only applies when
-      * the lower-layer transport is channel_tls_t.
-      *
-      * For old link protocols, we can't rely on is_canonical getting
-      * set properly if we're talking to the right address, since we might
-      * have an out-of-date descriptor, and we will get no NETINFO cell to
-      * tell us about the right address.
-      */
-     if (!channel_is_canonical(chan) &&
-          channel_is_canonical_is_reliable(chan) &&
-         !matches_target) {
+     /* Only return canonical connections or connections where the address
+      * is the address we wanted. */
 -    if (!channel_is_canonical(chan) &&
 -        !channel_matches_target_addr_for_extend(chan, target_addr)) {
++    if (!channel_is_canonical(chan) && !matches_target) {
        ++n_noncanonical;
        continue;
      }
Simple merge
Simple merge
Simple merge
index 849cc497fc1a1aceef6b6875c96f0cb94d03bd4c,afb7db813ccf01e16c3129cfde400f6da30c7f59..83b69cc80b725ccca8f0281174ddae335911551d
@@@ -1463,10 -1473,9 +1461,10 @@@ test_channel_for_extend(void *arg
    chan2->is_bad_for_new_circs = 0;
  
    /* Non canonical channels. */
+   test_chan_should_be_canonical = 0;
    test_chan_should_match_target = 0;
-   test_chan_canonical_should_be_reliable = 1;
 -  ret_chan = channel_get_for_extend(digest, &ed_id, &addr, &msg, &launch);
 +  ret_chan = channel_get_for_extend(digest, &ed_id, &ipv4_addr, &ipv6_addr,
 +                                    &msg, &launch);
    tt_assert(!ret_chan);
    tt_str_op(msg, OP_EQ, "Connections all too old, or too non-canonical. "
                          " Launching a new one.");