From 629c386dc5e72eed9f442993d379263d68064547 Mon Sep 17 00:00:00 2001 From: Nathan Aclander Date: Sun, 10 Jan 2016 16:28:22 -0800 Subject: [PATCH] Add the option to disable sshuttle ipv6 support Using --disable-ipv6 will now force sshuttle not to capture ipv6 traffic, even if the client supports ipv6. --- sshuttle/__main__.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sshuttle/__main__.py b/sshuttle/__main__.py index 7267ca7..f2cdc57 100644 --- a/sshuttle/__main__.py +++ b/sshuttle/__main__.py @@ -130,6 +130,7 @@ e,ssh-cmd= the command to use to connect to the remote [ssh] seed-hosts= with -H, use these hostnames for initial scan (comma-separated) no-latency-control sacrifice latency to improve bandwidth benchmarks wrap= restart counting channel numbers after this number (for testing) +disable-ipv6 disables ipv6 support D,daemon run in the background as a daemon s,subnets= file where the subnets are stored, instead of on the command line syslog send log messages to syslog (default if you use --daemon) @@ -186,10 +187,7 @@ try: method_name = opt.method else: o.fatal("method_name %s not supported" % opt.method) - if not opt.listen: - ipport_v6 = "auto" # parse_ipport6('[::1]:0') - ipport_v4 = "auto" # parse_ipport4('127.0.0.1:0') - else: + if opt.listen: ipport_v6 = None ipport_v4 = None list = opt.listen.split(",") @@ -198,6 +196,11 @@ try: ipport_v6 = parse_ipport6(ip) else: ipport_v4 = parse_ipport4(ip) + else: + # parse_ipport4('127.0.0.1:0') + ipport_v4 = "auto" + # parse_ipport6('[::1]:0') + ipport_v6 = "auto" if not opt.disable_ipv6 else None if opt.syslog: ssyslog.start_syslog() ssyslog.stderr_to_syslog()