1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Fix recreate a link with dynamips

Fix #1122
This commit is contained in:
Julien Duponchelle 2017-07-12 11:33:32 +02:00
parent 2e592d3199
commit cf17176bfc
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8
2 changed files with 14 additions and 2 deletions

View File

@ -92,6 +92,8 @@ class NIOUDP(NIO):
@asyncio.coroutine
def close(self):
if self._local_tunnel_lport:
name = 'DYNAMIPS-{}-{}'.format(self._local_tunnel_lport, self._local_tunnel_rport)
yield from self._node.ubridge_delete_bridge(name)
self._node.manager.port_manager.release_udp_port(self._local_tunnel_lport, self ._node.project)
if self._local_tunnel_rport:
self._node.manager.port_manager.release_udp_port(self._local_tunnel_rport, self._node.project)

View File

@ -1281,6 +1281,17 @@ class Router(BaseNode):
yield from self.slot_enable_nio(slot_number, port_number)
adapter.add_nio(port_number, nio)
@asyncio.coroutine
def slot_update_nio_binding(self, slot_number, port_number, nio):
"""
Update a slot NIO binding.
:param slot_number: slot number
:param port_number: port number
:param nio: NIO instance to add to the slot/port
"""
pass
@asyncio.coroutine
def slot_remove_nio_binding(self, slot_number, port_number):
"""
@ -1313,8 +1324,7 @@ class Router(BaseNode):
nio = adapter.get_nio(port_number)
if nio is None:
return
if isinstance(nio, NIOUDP):
self.manager.port_manager.release_udp_port(nio.lport, self._project)
yield from nio.close()
adapter.remove_nio(port_number)
log.info('Router "{name}" [{id}]: NIO {nio_name} removed from port {slot_number}/{port_number}'.format(name=self._name,