diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-06-23 04:25:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-23 04:25:44 -0400 |
commit | e159eb892b969a035f6f34239369771536ff4a9b (patch) | |
tree | f2b8b70edcb4033047833bd11920acbaf74cb189 /libpod | |
parent | d3afc6b3b6d6ba1d900b74d24affb132f38622d3 (diff) | |
parent | a84fa194b76dfd1776e01e192529d73ee32389ca (diff) | |
download | podman-e159eb892b969a035f6f34239369771536ff4a9b.tar.gz podman-e159eb892b969a035f6f34239369771536ff4a9b.tar.bz2 podman-e159eb892b969a035f6f34239369771536ff4a9b.zip |
Merge pull request #10754 from Luap99/sync-lock
getContainerNetworkInfo: lock netNsCtr before sync
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/networking_linux.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go index 9145569fb..1b775a4f3 100644 --- a/libpod/networking_linux.go +++ b/libpod/networking_linux.go @@ -908,6 +908,10 @@ func (c *Container) getContainerNetworkInfo() (*define.InspectNetworkSettings, e if err != nil { return nil, err } + // see https://github.com/containers/podman/issues/10090 + // the container has to be locked for syncContainer() + netNsCtr.lock.Lock() + defer netNsCtr.lock.Unlock() // Have to sync to ensure that state is populated if err := netNsCtr.syncContainer(); err != nil { return nil, err |