1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-25 08:18:30 +00:00

Handle vmnet interfaces in the cloud on OSX. Fixes #554.

This commit is contained in:
grossmj 2016-06-09 19:00:33 -06:00
parent a35f41e4dc
commit 3c9e8507d1

View File

@ -165,9 +165,15 @@ class Cloud(BaseNode):
interface=port_info["interface"]))
else:
if sys.platform.startswith("darwin") and port_info["interface"].startswith("en"):
# Wireless adapters are not well supported by the libpcap on OSX
raise NodeError("Connecting to a Wireless adapter is not supported.")
yield from self._ubridge_send('bridge add_nio_ethernet {name} "{interface}"'.format(name=bridge_name,
interface=port_info["interface"]))
if sys.platform.startswith("darwin") and port_info["interface"].startswith("vmnet"):
# Use a special NIO to connect to VMware vmnet interfaces on OSX (libpcap doesn't support them)
yield from self._ubridge_send('bridge add_nio_fusion_vmnet {name} "{interface}"'.format(name=bridge_name,
interface=port_info["interface"]))
else:
yield from self._ubridge_send('bridge add_nio_ethernet {name} "{interface}"'.format(name=bridge_name,
interface=port_info["interface"]))
elif port_info["type"] == "tap":
yield from self._ubridge_send('bridge add_nio_tap {name} "{interface}"'.format(name=bridge_name,