Commit 6a9571a9 authored by Jondy Zhao's avatar Jondy Zhao

Add all tap-drivers at startup;

Add subnet route at artup;
Remove --persist-tun for openvpn;
parent e599e3aa
......@@ -10,7 +10,7 @@ def openvpn(iface, encrypt, *args, **kw):
args = ['openvpn',
'--dev-type', 'tap',
'--dev-node' if sys.platform == 'cygwin' else '--dev', iface,
'--persist-tun',
'' if sys.platform == 'cygwin' else '--persist-tun',
'--persist-key',
'--script-security', '2',
'--up', ovpn_client,
......
......@@ -271,6 +271,9 @@ def main():
# not even remove it on exit.
subprocess.call(if_rt)
if_rt[4] = my_subnet
if sys.platform == 'cygwin':
ip('route', my_subnet, 'dev', config.main_interface)
else:
cleanup.append(lambda: subprocess.call(if_rt))
x = [my_network]
if config.table:
......@@ -302,6 +305,11 @@ def main():
for cmd in config.daemon or ():
cleanup.append(utils.Popen(cmd, shell=True).stop)
# adding tap-windows driver will break others, so we add
# all drivers here
if sys.platform == 'cygwin':
[ ip('vpntap', 'dev', x) for x in tunnel_interfaces ]
# main loop
if tunnel_manager is None:
sys.exit(os.WEXITSTATUS(os.wait()[1]))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment