MCPcopy Index your code
hub / github.com/sshuttle/sshuttle / onroutes

Function onroutes

sshuttle/client.py:731–756  ·  view source on GitHub ↗
(routestr)

Source from the content-addressed store, hash-verified

729 log('daemonizing (%s).' % _pidname)
730
731 def onroutes(routestr):
732 if auto_nets:
733 for line in routestr.strip().split(b'\n'):
734 if not line:
735 continue
736 (family, ip, width) = line.split(b',', 2)
737 family = int(family)
738 width = int(width)
739 ip = ip.decode("ASCII")
740 if family == socket.AF_INET6 and tcp_listener.v6 is None:
741 debug2("Ignored auto net %d/%s/%d" % (family, ip, width))
742 if family == socket.AF_INET and tcp_listener.v4 is None:
743 debug2("Ignored auto net %d/%s/%d" % (family, ip, width))
744 else:
745 debug2("Adding auto net %d/%s/%d" % (family, ip, width))
746 fw.auto_nets.append((family, ip, width, 0, 0))
747
748 # we definitely want to do this *after* starting ssh, or we might end
749 # up intercepting the ssh connection!
750 #
751 # Moreover, now that we have the --auto-nets option, we have to wait
752 # for the server to send us that message anyway. Even if we haven't
753 # set --auto-nets, we might as well wait for the message first, then
754 # ignore its contents.
755 mux.got_routes = None
756 serverready()
757
758 mux.got_routes = onroutes
759

Callers

nothing calls this directly

Calls 2

debug2Function · 0.90
serverreadyFunction · 0.85

Tested by

no test coverage detected