Skip to content

Commit

Permalink
podman machine: remove hostip from port
Browse files Browse the repository at this point in the history
Inside the podman machine vm we always remove the hostip from the port
mapping because this should only be used on the actual host. Otherwise
you run into issues when we would bind 127.0.0.1 or try to bind a
host address that is not available in the VM.

This was already done for cni/netavark ports and slirp4netns but not for
the port bindings inside libpod which are only used as root.

[NO NEW TESTS NEEDED] We still do not have machine tests!

Fixes containers#13543

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
  • Loading branch information
Luap99 committed Jul 13, 2022
1 parent 0efcc43 commit ebfdf91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libpod/oci_conmon_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ func (r *ConmonOCIRuntime) createOCIContainer(ctr *Container, restoreOptions *Co
cmd.ExtraFiles = append(cmd.ExtraFiles, childSyncPipe, childStartPipe)

if r.reservePorts && !rootless.IsRootless() && !ctr.config.NetMode.IsSlirp4netns() {
ports, err := bindPorts(ctr.config.PortMappings)
ports, err := bindPorts(ctr.convertPortMappings())
if err != nil {
return 0, err
}
Expand Down

0 comments on commit ebfdf91

Please sign in to comment.