Merge remote-tracking branch 'origin/2.2' into 3.0

# Conflicts:
#	CHANGELOG
#	dev-requirements.txt
#	gns3server/crash_report.py
#	gns3server/version.py
#	requirements.txt
This commit is contained in:
grossmj 2026-02-11 17:52:14 +08:00
commit aabfd08524
No known key found for this signature in database
GPG Key ID: 1E7DD6DBB53FF3D7
4 changed files with 24 additions and 7 deletions

View File

@ -1,5 +1,11 @@
# Change Log
## 2.2.56.1 28/01/2026
* Fix telnet keepalive options on macOS
* Upgrade dependencies
* Drop Python 3.8 support
## 3.0.6 28/01/2026
* Sync appliances

View File

@ -1,4 +1,5 @@
pytest==8.4.2 # version 8.4.2 is the last one supporting Python 3.9
pytest==8.4.2; python_version == '3.9' # version 8.4.2 is the last one supporting Python 3.9
pytest==9.0.2; python_version >= '3.10'
flake8==7.3.0
pytest-timeout==2.4.0
pytest-asyncio==0.26.0 # upgrading leads to stuck / failed tests

View File

@ -184,15 +184,25 @@ class AsyncioTelnetServer:
await writer.drain()
async def run(self, network_reader, network_writer):
sock = network_writer.get_extra_info("socket")
sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
# 60 sec keep alives, close tcp session after 4 missed
# Will keep a firewall from aging out telnet console.
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 60)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 10)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 4)
try:
# Keepalive options are platform dependent: Linux uses TCP_KEEPIDLE,
# while macOS exposes TCP_KEEPALIVE (in Python >= 3.10).
if hasattr(socket, "TCP_KEEPIDLE"):
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 60)
elif hasattr(socket, "TCP_KEEPALIVE"):
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPALIVE, 60)
else:
raise AttributeError("module 'socket' has no attribute 'TCP_KEEPIDLE' or 'TCP_KEEPALIVE'")
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 10)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 4)
except (AttributeError, OSError):
log.debug("Failed to tune TCP keepalive for telnet client; using OS defaults", exc_info=True)
#log.debug("New connection from {}".format(sock.getpeername()))
# Keep track of connected clients

View File

@ -6,8 +6,8 @@ websockets==15.0.1 # version 15.0.1 is the last to support Python 3.9
aiohttp>=3.13.3,<3.14
aiofiles>=25.1.0,<26.0
Jinja2>=3.1.6,<3.2
sentry-sdk>=2.50.0,<3 # optional dependency
psutil>=7.2.1
sentry-sdk>=2.52.0,<3 # optional dependency
psutil>=7.2.2
async-timeout>=5.0.1,<5.1; python_version < '3.11' # this library has effectively been upstreamed into Python 3.11+
distro>=1.9.0
py-cpuinfo>=9.0.0,<10.0