Files
podman/libpod/networking_pasta_linux.go
Paul Holzinger dc1795b4b2 use new c/common pasta2 setup logic to fix dns
By default we just ignored any localhost reolvers, this is problematic
for anyone with more complicated dns setups, i.e. split dns with
systemd-reolved. To address this we now make use of the build in dns
proxy in pasta. As such we need to set the default nameserver ip now.

A second change is the option to exclude certain ips when generating the
host.containers.internal ip. With that we no longer set it to the same
ip as is used in the netns. The fix is not perfect as it could mean on a
system with a single ip we no longer add the entry, however given the
previous entry was incorrect anyway this seems like the better behavior.

Fixes #22044

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-03-19 12:09:31 +01:00

27 lines
634 B
Go

//go:build !remote
// SPDX-License-Identifier: Apache-2.0
//
// networking_pasta_linux.go - Start pasta(1) for user-mode connectivity
//
// Copyright (c) 2022 Red Hat GmbH
// Author: Stefano Brivio <sbrivio@redhat.com>
package libpod
import "github.com/containers/common/libnetwork/pasta"
func (r *Runtime) setupPasta(ctr *Container, netns string) error {
res, err := pasta.Setup2(&pasta.SetupOptions{
Config: r.config,
Netns: netns,
Ports: ctr.convertPortMappings(),
ExtraOptions: ctr.config.NetworkOptions[pasta.BinaryName],
})
if err != nil {
return err
}
ctr.pastaResult = res
return nil
}