mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-07-07 10:10:34 +02:00
Smarter listenport selection.
Now if we aren't given an explicit port, we always initiate the port search at 12300 and count upward looking for an available port. Normally the kernel will assign us a random port, but that's not ideal in our case because we'd like to use the same port numbers whenever possible; that avoids piling up crap inside iptables in the (hopefully unlikely) event that we die without cleaning up correctly.
This commit is contained in:
4
main.py
4
main.py
@ -66,10 +66,10 @@ elif opt.iptables:
|
||||
parse_subnets(extra[1:])))
|
||||
else:
|
||||
if len(extra) < 1:
|
||||
o.fatal('at least one argument expected')
|
||||
o.fatal('at least one subnet expected')
|
||||
remotename = extra[0]
|
||||
if remotename == '' or remotename == '-':
|
||||
remotename = None
|
||||
sys.exit(client.main(parse_ipport(opt.listen or '0.0.0.0:1234'),
|
||||
sys.exit(client.main(parse_ipport(opt.listen or '0.0.0.0:0'),
|
||||
remotename,
|
||||
parse_subnets(extra)))
|
||||
|
Reference in New Issue
Block a user