aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-10-04 10:31:25 -0400
committerNick Mathewson <nickm@torproject.org>2012-10-04 10:31:25 -0400
commit03e4b5a9d7ab918dcd121f0ac4586e798e7ff5b0 (patch)
tree0a82ee0eb13313b04d12e7e3d3e0d816758f1e8b
parentd9847165e0f8b6528acdf3e7246c454c3c4b1597 (diff)
parentce553d49821cf96666afe2380b2409329c71cd8b (diff)
downloadtor-03e4b5a9d7ab918dcd121f0ac4586e798e7ff5b0.tar
tor-03e4b5a9d7ab918dcd121f0ac4586e798e7ff5b0.tar.gz
Merge remote-tracking branch 'linus/bug6757'
-rw-r--r--changes/67575
-rw-r--r--src/or/circuitbuild.c12
-rw-r--r--src/or/nodelist.c19
3 files changed, 20 insertions, 16 deletions
diff --git a/changes/6757 b/changes/6757
new file mode 100644
index 000000000..6b17f951d
--- /dev/null
+++ b/changes/6757
@@ -0,0 +1,5 @@
+ o Minor bugfixes (client):
+ - Make clients running with IPv6 bridges connect over IPv6 again,
+ even without setting new config options ClientUseIPv6 and
+ ClientPreferIPv6ORPort.
+ Fixes bug 6757; bugfix on 0.2.4.1-alpha.
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 230dd8105..56c2c22d0 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -5663,15 +5663,9 @@ rewrite_node_address_for_bridge(const bridge_info_t *bridge, node_t *node)
}
}
- /* Mark bridge as preferably connected to over IPv6 if its IPv6
- address is in a Bridge line and ClientPreferIPv6ORPort is
- set. Unless both is true, a potential IPv6 OR port of this
- bridge won't get selected.
-
- XXX ipv6_preferred is never reset (#6757) */
- if (get_options()->ClientPreferIPv6ORPort == 1 &&
- tor_addr_family(&bridge->addr) == AF_INET6)
- node->ipv6_preferred = 1;
+ /* Mark which address to use based on which bridge_t we got. */
+ node->ipv6_preferred = (tor_addr_family(&bridge->addr) == AF_INET6 &&
+ !tor_addr_is_null(&node->ri->ipv6_addr));
/* XXXipv6 we lack support for falling back to another address for
the same relay, warn the user */
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index 642816cca..29b6047ac 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -872,18 +872,23 @@ node_get_prim_orport(const node_t *node, tor_addr_port_t *ap_out)
void
node_get_pref_orport(const node_t *node, tor_addr_port_t *ap_out)
{
+ const or_options_t *options = get_options();
tor_assert(ap_out);
/* Cheap implementation of config option ClientUseIPv6 -- simply
- don't prefer IPv6 when ClientUseIPv6 is not set. (See #4455 for
- more on this subject.) Note that this filter is too strict since
- we're hindering not only clients! Erring on the safe side
- shouldn't be a problem though. XXX move this check to where
- outgoing connections are made? -LN */
- if (get_options()->ClientUseIPv6 == 1 && node_ipv6_preferred(node))
+ don't prefer IPv6 when ClientUseIPv6 is not set and we're not a
+ client running with bridges. See #4455 for more on this subject.
+
+ Note that this filter is too strict since we're hindering not
+ only clients! Erring on the safe side shouldn't be a problem
+ though. XXX move this check to where outgoing connections are
+ made? -LN */
+ if ((options->ClientUseIPv6 || options->UseBridges) &&
+ node_ipv6_preferred(node)) {
node_get_pref_ipv6_orport(node, ap_out);
- else
+ } else {
node_get_prim_orport(node, ap_out);
+ }
}
/** Copy the preferred IPv6 OR port (IP address and TCP port) for