From 167a0b8435ad0febc16535c4b7861a43366b1f80 Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 10 Feb 2016 19:08:34 -0700 Subject: [PATCH] Add verification when UDP tunnel is created in a VirtualBox VM. Ref #899. --- gns3server/modules/virtualbox/virtualbox_vm.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gns3server/modules/virtualbox/virtualbox_vm.py b/gns3server/modules/virtualbox/virtualbox_vm.py index 40181b12..526f7e64 100644 --- a/gns3server/modules/virtualbox/virtualbox_vm.py +++ b/gns3server/modules/virtualbox/virtualbox_vm.py @@ -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))