mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 22:11:14 +02:00
Prevent connect a node to himself
Fix https://github.com/GNS3/gns3-gui/issues/1553
This commit is contained in:
7 files changed
+79
-7
No files matched your search
@@ -61,6 +61,9 @@ class Link:
|
||||
self._link_type = port.link_type
|
||||
|
||||
for other_node in self._nodes:
|
||||
if other_node["node"] == node:
|
||||
raise aiohttp.web.HTTPConflict(text="Cannot connect to itself")
|
||||
|
||||
if node.node_type in ["nat", "cloud"]:
|
||||
if other_node["node"].node_type in ["nat", "cloud"]:
|
||||
raise aiohttp.web.HTTPConflict(text="It's not allowed to connect a {} to a {}".format(other_node["node"].node_type, node.node_type))
|
||||
|
||||
Reference in new issue
Block a user