container-libs: Use 127.0.0.1 for host.containers.internal with Host Network

Scritto da Alessio il 21/01/2026

Problem

container-libs wasn't handling host network mode correctly when determining the host address for container-to-host communication.

Solution

Implemented detection for host network mode and returned 127.0.0.1 instead of host.containers.internal when appropriate. This matches the behavior needed for containers running with host network access.

Result

Consistent host address resolution across container runtimes and host network configurations.

Commit: containers/container-libs@38d7ee7