summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sshuttle/assembler.py3
-rw-r--r--sshuttle/client.py3
-rw-r--r--sshuttle/server.py16
3 files changed, 15 insertions, 7 deletions
diff --git a/sshuttle/assembler.py b/sshuttle/assembler.py
index 06ff672..31e5600 100644
--- a/sshuttle/assembler.py
+++ b/sshuttle/assembler.py
@@ -35,4 +35,5 @@ sshuttle.helpers.verbose = verbosity
import sshuttle.cmdline_options as options
from sshuttle.server import main
-main(options.latency_control, options.auto_hosts, options.to_nameserver)
+main(options.latency_control, options.auto_hosts, options.to_nameserver,
+ options.auto_nets)
diff --git a/sshuttle/client.py b/sshuttle/client.py
index e7d8e8f..cab5b1c 100644
--- a/sshuttle/client.py
+++ b/sshuttle/client.py
@@ -453,7 +453,8 @@ def _main(tcp_listener, udp_listener, fw, ssh_cmd, remotename,
stderr=ssyslog._p and ssyslog._p.stdin,
options=dict(latency_control=latency_control,
auto_hosts=auto_hosts,
- to_nameserver=to_nameserver))
+ to_nameserver=to_nameserver,
+ auto_nets=auto_nets))
except socket.error as e:
if e.args[0] == errno.EPIPE:
raise Fatal("failed to establish ssh session (1)")
diff --git a/sshuttle/server.py b/sshuttle/server.py
index 0f3b17a..c2d2b5c 100644
--- a/sshuttle/server.py
+++ b/sshuttle/server.py
@@ -279,7 +279,7 @@ class UdpProxy(Handler):
self.mux.send(self.chan, ssnet.CMD_UDP_DATA, hdr + data)
-def main(latency_control, auto_hosts, to_nameserver):
+def main(latency_control, auto_hosts, to_nameserver, auto_nets):
debug1('Starting server with Python version %s\n'
% platform.python_version())
@@ -289,10 +289,6 @@ def main(latency_control, auto_hosts, to_nameserver):
helpers.logprefix = 'server: '
debug1('latency control setting = %r\n' % latency_control)
- routes = list(list_routes())
- debug1('available routes:\n')
- for r in routes:
- debug1(' %d/%s/%d\n' % r)
# synchronization header
sys.stdout.write('\0\0SSHUTTLE0001')
@@ -304,6 +300,16 @@ def main(latency_control, auto_hosts, to_nameserver):
socket.fromfd(sys.stdout.fileno(),
socket.AF_INET, socket.SOCK_STREAM))
handlers.append(mux)
+
+ debug1('auto-nets:' + str(auto_nets) + '\n')
+ if auto_nets:
+ routes = list(list_routes())
+ debug1('available routes:\n')
+ for r in routes:
+ debug1(' %d/%s/%d\n' % r)
+ else:
+ routes = []
+
routepkt = ''
for r in routes:
routepkt += '%d,%s,%d\n' % r