mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
1 parent
0a536278fc
commit
42c8fb7c29
2 files changed
+25
-7
No files matched your search
@@ -203,6 +203,8 @@ class PortManager:
|
||||
|
||||
if port in self._used_tcp_ports:
|
||||
raise HTTPConflict(text="TCP port {} already in use on host".format(port, self._console_host))
|
||||
if port < self._console_port_range[0] or port > self._console_port_range[1]:
|
||||
raise HTTPConflict(text="TCP port {} is outside the range {}-{}".format(port, self._console_port_range[0], self._console_port_range[1]))
|
||||
self._used_tcp_ports.add(port)
|
||||
project.record_tcp_port(port)
|
||||
log.debug("TCP port {} has been reserved".format(port))
|
||||
@@ -249,6 +251,8 @@ class PortManager:
|
||||
|
||||
if port in self._used_udp_ports:
|
||||
raise HTTPConflict(text="UDP port {} already in use on host".format(port, self._console_host))
|
||||
if port < self._udp_port_range[0] or port > self._udp_port_range[1]:
|
||||
raise HTTPConflict(text="UDP port {} is outside the range {}-{}".format(port, self._udp_port_range[0], self._udp_port_range[1]))
|
||||
self._used_udp_ports.add(port)
|
||||
project.record_udp_port(port)
|
||||
log.debug("UDP port {} has been reserved".format(port))
|
||||
|
||||
Reference in new issue
Block a user