diff options
author | Paul Holzinger <pholzing@redhat.com> | 2021-09-01 15:56:25 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2021-09-01 16:14:40 +0200 |
commit | abdedc31a25e74866c8afef115d3f87c3b808741 (patch) | |
tree | 692dc200f3fbcbc1a032b48c9573dd5f51e60030 /libpod | |
parent | bebaef26fdd5d3ae8a29f04d36c437f316fc1bc8 (diff) | |
download | podman-abdedc31a25e74866c8afef115d3f87c3b808741.tar.gz podman-abdedc31a25e74866c8afef115d3f87c3b808741.tar.bz2 podman-abdedc31a25e74866c8afef115d3f87c3b808741.zip |
rootlessport: allow socket paths with more than 108 chars
Creating the rootlessport socket can fail with `bind: invalid argument`
when the socket path is longer than 108 chars. This is the case for
users with a long runtime directory.
Since the kernel does not allow to use socket paths with more then 108
chars use a workaround to open the socket path.
[NO TESTS NEEDED]
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/networking_slirp4netns.go | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/libpod/networking_slirp4netns.go b/libpod/networking_slirp4netns.go index 5858364ff..a09027b72 100644 --- a/libpod/networking_slirp4netns.go +++ b/libpod/networking_slirp4netns.go @@ -632,16 +632,7 @@ func (c *Container) reloadRootlessRLKPortMapping() error { childIP := getRootlessPortChildIP(c) logrus.Debugf("reloading rootless ports for container %s, childIP is %s", c.config.ID, childIP) - var conn net.Conn - var err error - // try three times to connect to the socket, maybe it is not ready yet - for i := 0; i < 3; i++ { - conn, err = net.Dial("unix", filepath.Join(c.runtime.config.Engine.TmpDir, "rp", c.config.ID)) - if err == nil { - break - } - time.Sleep(250 * time.Millisecond) - } + conn, err := openUnixSocket(filepath.Join(c.runtime.config.Engine.TmpDir, "rp", c.config.ID)) if err != nil { // This is not a hard error for backwards compatibility. A container started // with an old version did not created the rootlessport socket. |