mirror of
https://github.com/containers/podman.git
synced 2025-05-20 08:36:23 +08:00
Fix rootlesskit port forwarder with custom slirp cidr
The source ip for the rootlesskit port forwarder was hardcoded to the standard slirp4netns ip. This is incorrect since users can change the subnet used by slirp4netns with `--network slirp4netns:cidr=10.5.0.0/24`. The container interface ip is always the .100 in the subnet. Only when the rootlesskit port forwarder child ip matches the container interface ip the port forwarding will work. Fixes #9828 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
This commit is contained in:
@ -577,7 +577,7 @@ func (r *Runtime) setupRootlessNetNS(ctr *Container) error {
|
||||
// set up port forwarder for CNI-in-slirp4netns
|
||||
netnsPath := ctr.state.NetNS.Path()
|
||||
// TODO: support slirp4netns port forwarder as well
|
||||
return r.setupRootlessPortMappingViaRLK(ctr, netnsPath)
|
||||
return r.setupRootlessPortMappingViaRLK(ctr, netnsPath, "")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user