1.1.31 bury taptun2 deeper so that windows can't accidentally touch it

This commit is contained in:
Kevin Hester
2020-12-31 09:17:16 +08:00
parent 0e989ee9c5
commit 5a56207440
5 changed files with 52 additions and 36 deletions

View File

@@ -11,8 +11,6 @@ import pkg_resources
"""We only import the tunnel code if we are on a platform that can run it"""
have_tunnel = platform.system() == 'Linux'
if have_tunnel:
from . import tunnel
"""The command line arguments"""
args = None
@@ -279,6 +277,7 @@ def onConnected(interface):
print(url.terminal())
if have_tunnel and args.tunnel :
from . import tunnel
closeNow = False # Even if others said we could close, stay open if the user asked for a tunnel
tunnel.Tunnel(interface, subnet=args.tunnel_net)

View File

@@ -15,7 +15,6 @@
from . import portnums_pb2
from pubsub import pub
from pytap2 import TapDevice
import logging, threading
# A new non standard log level that is lower level than DEBUG
@@ -90,6 +89,7 @@ class Tunnel:
logging.debug("creating TUN device")
# FIXME - figure out real max MTU, it should be 240 - the overhead bytes for SubPacket and Data
from pytap2 import TapDevice
self.tun = TapDevice(name="mesh", mtu=200)
self.tun.up()
self.tun.ifconfig(address=myAddr,netmask=netmask)