mirror of
https://github.com/containers/podman.git
synced 2025-06-17 15:08:08 +08:00
Make netns bind mount shared
To 'avoid unknown FS magic on "/run/user/1000/netns/...": 1021994' make the network namespace bind-mount recursively shared, so the mount is back-propogated to the host. Signed-off-by: gabi beyer <gabrielle.n.beyer@intel.com>
This commit is contained in:

committed by
Marco Vedovati

parent
f50ba201c4
commit
0115be19f5
@ -152,8 +152,9 @@ func NewNS() (ns.NetNS, error) {
|
||||
|
||||
// bind mount the netns from the current thread (from /proc) onto the
|
||||
// mount point. This causes the namespace to persist, even when there
|
||||
// are no threads in the ns.
|
||||
err = unix.Mount(getCurrentThreadNetNSPath(), nsPath, "none", unix.MS_BIND, "")
|
||||
// are no threads in the ns. Make this a shared mount; it needs to be
|
||||
// back-propogated to the host
|
||||
err = unix.Mount(getCurrentThreadNetNSPath(), nsPath, "none", unix.MS_BIND|unix.MS_SHARED|unix.MS_REC, "")
|
||||
if err != nil {
|
||||
err = fmt.Errorf("failed to bind mount ns at %s: %v", nsPath, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user