mirror of
https://github.com/moby/moby.git
synced 2026-07-25 08:47:01 +00:00
With improved IPv6 support, a dual-stack container can map a port using two different networks -- one IPv4-only, the other IPv6-only. The daemon was updating containers' `EndpointSettings.Ports` by looking for the first network providing port-mappings. This was incorrect. Instead, iterate over the whole list of endpoints, and merge everything together. The function doing that, ie. `getEndpointPortMapInfo`, is also considered exposed ports, and nil the PortMap entry if an exposed port is found. However, exposed ports are always set on a bridge network, so this was erasing port-mappings found for other networks. Signed-off-by: Albin Kerouanton <albinker@gmail.com>