From 9c81b8cf7219e7e7507e41e867295ff158028a0a Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 15 Jun 2021 13:26:02 +0200 Subject: add correct slirp ip to /etc/hosts The container name should have the slirp interface ip set in /etc/hosts and not the gateway ip. Commit c8dfcce6db0a introduced this regression. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1972073 Signed-off-by: Paul Holzinger --- libpod/container_internal_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpod/container_internal_linux.go') diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index ddfccb999..564c81373 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -1816,7 +1816,7 @@ func (c *Container) getHosts() string { if c.Hostname() != "" { if c.config.NetMode.IsSlirp4netns() { // When using slirp4netns, the interface gets a static IP - slirp4netnsIP, err := GetSlirp4netnsGateway(c.slirp4netnsSubnet) + slirp4netnsIP, err := GetSlirp4netnsIP(c.slirp4netnsSubnet) if err != nil { logrus.Warn("failed to determine slirp4netnsIP: ", err.Error()) } else { -- cgit v1.2.3-54-g00ecf