mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-19 12:57:56 +00:00
Add verification when UDP tunnel is created in a VirtualBox VM. Ref #899.
This commit is contained in:
parent
5842487cd0
commit
167a0b8435
@ -879,6 +879,14 @@ class VirtualBoxVM(BaseVM):
|
||||
yield from self._control_vm("nicproperty{} dest={}".format(adapter_number + 1, nio.rhost))
|
||||
yield from self._control_vm("nicproperty{} dport={}".format(adapter_number + 1, nio.rport))
|
||||
yield from self._control_vm("setlinkstate{} on".format(adapter_number + 1))
|
||||
|
||||
# check if the UDP tunnel has been correctly set
|
||||
vm_info = yield from self._get_vm_info()
|
||||
generic_driver_number = "generic{}".format(adapter_number + 1)
|
||||
if not generic_driver_number in vm_info and vm_info[generic_driver_number] != "UDPTunnel":
|
||||
log.warning("UDP tunnel has not been set on nic: {}\n{}".format(adapter_number + 1))
|
||||
self.project.emit("log.warning", {"message": "UDP tunnel has not been set on nic: {}\n{}".format(adapter_number + 1)})
|
||||
|
||||
elif isinstance(nio, NIONAT):
|
||||
yield from self._control_vm("nic{} nat".format(adapter_number + 1))
|
||||
yield from self._control_vm("setlinkstate{} on".format(adapter_number + 1))
|
||||
|
Loading…
Reference in New Issue
Block a user