Merge pull request #469 from marek22k/improve-argument-handling

Improve argument handling
This commit is contained in:
Ben Meadors authored and GitHub committed 2024-01-04 20:30:36 -06:00
commit fe8ae6237e
2 files changed
+10 -1

No files matched your search

+4 -1
View File
@@ -771,7 +771,10 @@ def onConnected(interface):
if interface.noProto:
logging.warning(f"Not starting Tunnel - disabled by noProto")
else:
tunnel.Tunnel(interface, subnet=args.tunnel_net)
if args.tunnel_net:
tunnel.Tunnel(interface, subnet=args.tunnel_net)
else:
tunnel.Tunnel(interface)
if args.ack or (args.dest != BROADCAST_ADDR and waitForAckNak):
print(
+6
View File
@@ -49,6 +49,12 @@ class Tunnel:
if not iface:
raise Exception("Tunnel() must have a interface")
if not subnet:
raise Exception("Tunnel() must have a subnet")
if not netmask:
raise Exception("Tunnel() must have a netmask")
self.iface = iface
self.subnetPrefix = subnet