Files
Mathieu Champlon 86626bb2ce daemon/libnetwork/portallocator: skip kernel-reserved ports
The allocator reads its bounds from net.ipv4.ip_local_port_range but
ignored net.ipv4.ip_local_reserved_ports, so dynamically allocated host
ports could land on ports the kernel itself would never hand out
automatically, typically ports set aside for other applications.

Skip those ports when allocating from the default ephemeral range,
mirroring the kernel behaviour for automatic port assignment. Requests
for a specific port or an explicit port range are unchanged, like
explicit binds are unchanged by ip_local_reserved_ports.

Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
2026-06-12 12:09:28 +02:00
..