summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian May <brian@linuxpenguins.xyz>2016-03-08 18:44:43 +1100
committerBrian May <brian@linuxpenguins.xyz>2016-03-08 18:49:47 +1100
commit2b0d0065c7e415d89b92e1a59887f9fc5a8247ab (patch)
tree93c9ec1eb4c8385f1e133a4c558405d36cf266f7
parent9e3f02c1995f06d358ea03c9c5f2ac933996b680 (diff)
Don't force IPv6 if IPv6 name servers
Just because we may have found IPv6 DNS servers from /etc/resolv.conf doesn't mean we should force IPv6 support. Instead we should disable the IPv6 DNS servers if IPv6 is disabled. Note: this will also result in any IPv6 servers specified on the command line being silently ignored too. Specifying an IPv6 subnet will still require IPv6 support. Closes #74
-rw-r--r--sshuttle/client.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/sshuttle/client.py b/sshuttle/client.py
index d85ce08..4b4c89c 100644
--- a/sshuttle/client.py
+++ b/sshuttle/client.py
@@ -547,11 +547,15 @@ def main(listenip_v6, listenip_v4,
else:
listenip_v6 = None
- required.ipv6 = len(subnets_v6) > 0 or len(nslist_v6) > 0 \
- or listenip_v6 is not None
+ required.ipv6 = len(subnets_v6) > 0 or listenip_v6 is not None
required.udp = avail.udp
required.dns = len(nslist) > 0
+ # if IPv6 not supported, ignore IPv6 DNS servers
+ if not required.ipv6:
+ nslist_v6 = []
+ nslist = nslist_v4
+
fw.method.assert_features(required)
if required.ipv6 and listenip_v6 is None: