diff --git a/faradayio/faraday.py b/faradayio/faraday.py index 1bf2419..140b1db 100644 --- a/faradayio/faraday.py +++ b/faradayio/faraday.py @@ -85,13 +85,11 @@ def receive(self, length): class TunnelServer(object): def __init__(self, addr='10.0.0.1', - dstaddr='10.0.0.2', netmask='255.255.255.0', mtu=1500, name="Faraday"): self._tun = pytun.TunTapDevice(name=name) self._tun.addr = addr - self._tun.dstaddr = dstaddr self._tun.netmask = netmask self._tun.mtu = mtu self._tun.persist(True) @@ -103,13 +101,13 @@ def __del__(self): class Monitor(threading.Thread): - def __init__(self, serialPort, name, addr, dstaddr): + def __init__(self, serialPort, name, addr, mtu): super().__init__() self._isRunning = threading.Event() self._serialPort = serialPort # Start a TUN adapter - self._TUN = TunnelServer(name=name, addr=addr, dstaddr=dstaddr) + self._TUN = TunnelServer(name=name, addr=addr, mtu=mtu) # Create a Faraday instance self._faraday = Faraday(serialPort=serialPort) diff --git a/tests/test_tun.py b/tests/test_tun.py index dd763a4..9db8be0 100644 --- a/tests/test_tun.py +++ b/tests/test_tun.py @@ -28,7 +28,7 @@ def test_tunSend(): faradayTUN = faraday.TunnelServer() # Send a string throught the IP - HOST = faradayTUN._tun.dstaddr + HOST = "10.0.0.2" PORT = 9999 # Anything # Just send asci lprintable data for now @@ -85,7 +85,7 @@ def test_tunSlipSend(): TUNMonitor = faraday.Monitor(serialPort=serialPort, name="Faraday", addr=sourceHost, - dstaddr=destHost) + mtu=1500) srcPacket = (IP(dst=destHost, src=sourceHost) / @@ -146,7 +146,7 @@ def test_serialToTUN(): TUNMonitor = faraday.Monitor(serialPort=serialPort, name="Faraday", addr=tunAddress, - dstaddr=sourceAddress) + mtu=1500) # Open a socket for UDP packets and bind it to the TUN address:port s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)