From 17bd8d13c30005042a4c2dee5db4699ed565d77a Mon Sep 17 00:00:00 2001 From: Rogier 'DocWilco' Mulhuijzen Date: Sun, 18 Nov 2012 22:52:59 +0100 Subject: [PATCH 1/2] Don't send routes if auto_nets is not enabled Some machines have a full BGP table with nearly half a million routes. This causes all sorts of problems, so best not to send them unless we really need them. --- client.py | 3 ++- server.py | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/client.py b/client.py index a03ac3a..b793385 100644 --- a/client.py +++ b/client.py @@ -249,7 +249,8 @@ def _main(listener, fw, ssh_cmd, remotename, python, latency_control, try: (serverproc, serversock) = ssh.connect(ssh_cmd, remotename, python, stderr=ssyslog._p and ssyslog._p.stdin, - options=dict(latency_control=latency_control)) + options=dict(latency_control=latency_control + send_nets=auto_nets)) except socket.error, e: if e.args[0] == errno.EPIPE: raise Fatal("failed to establish ssh session (1)") diff --git a/server.py b/server.py index 1032d4c..40598fa 100644 --- a/server.py +++ b/server.py @@ -164,11 +164,16 @@ def main(): else: helpers.logprefix = 'server: ' debug1('latency control setting = %r\n' % latency_control) + debug1('send known routes = %r\n' % send_routes) - routes = list(list_routes()) - debug1('available routes:\n') - for r in routes: - debug1(' %s/%d\n' % r) + if send_routes: + routes = list(list_routes()) + debug1('available routes:\n') + for r in routes: + debug1(' %s/%d\n' % r) + else: + routes = list() + debug1('not sending routes\n') # synchronization header sys.stdout.write('\0\0SSHUTTLE0001') From 87d502cc65dc3d1608b1dff7e2b9338789b45c88 Mon Sep 17 00:00:00 2001 From: Rogier 'DocWilco' Mulhuijzen Date: Thu, 24 Oct 2013 11:50:48 -0700 Subject: [PATCH 2/2] Make this thing actually work if you _do_ want routes from remote. Derp. Actually test things, and such. --- client.py | 2 +- server.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client.py b/client.py index b793385..8c7e7da 100644 --- a/client.py +++ b/client.py @@ -249,7 +249,7 @@ def _main(listener, fw, ssh_cmd, remotename, python, latency_control, try: (serverproc, serversock) = ssh.connect(ssh_cmd, remotename, python, stderr=ssyslog._p and ssyslog._p.stdin, - options=dict(latency_control=latency_control + options=dict(latency_control=latency_control, send_nets=auto_nets)) except socket.error, e: if e.args[0] == errno.EPIPE: diff --git a/server.py b/server.py index 40598fa..16cd13e 100644 --- a/server.py +++ b/server.py @@ -164,9 +164,9 @@ def main(): else: helpers.logprefix = 'server: ' debug1('latency control setting = %r\n' % latency_control) - debug1('send known routes = %r\n' % send_routes) + debug1('send known routes = %r\n' % send_nets) - if send_routes: + if send_nets: routes = list(list_routes()) debug1('available routes:\n') for r in routes: