summaryrefslogtreecommitdiff
path: root/libpod/networking_linux.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2021-01-21 20:31:07 +0100
committerMatthew Heon <mheon@redhat.com>2021-02-03 15:46:35 -0500
commitf11aabd3e04aa68ddb35c3d1f90d50afb4d185c2 (patch)
tree2aaf7614f285e2f5e3794234d0aa67bb27781c1c /libpod/networking_linux.go
parent5172cfe6a5ab407e1cf90a6155e575c16114adba (diff)
downloadpodman-f11aabd3e04aa68ddb35c3d1f90d50afb4d185c2.tar.gz
podman-f11aabd3e04aa68ddb35c3d1f90d50afb4d185c2.tar.bz2
podman-f11aabd3e04aa68ddb35c3d1f90d50afb4d185c2.zip
libpod: move slirp magic IPs to consts
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/networking_linux.go')
-rw-r--r--libpod/networking_linux.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index 18ea78564..ffd39dfa9 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -35,6 +35,15 @@ import (
"golang.org/x/sys/unix"
)
+const (
+ // slirp4netnsIP is the IP used by slirp4netns to configure the tap device
+ // inside the network namespace.
+ slirp4netnsIP = "10.0.2.100"
+
+ // slirp4netnsDNS is the IP for the built-in DNS server in the slirp network
+ slirp4netnsDNS = "10.0.2.3"
+)
+
// Get an OCICNI network config
func (r *Runtime) getPodNetwork(id, name, nsPath string, networks []string, ports []ocicni.PortMapping, staticIP net.IP, staticMAC net.HardwareAddr, netDescriptions ContainerNetworkDescriptions) ocicni.PodNetwork {
var networkKey string
@@ -547,7 +556,7 @@ func (r *Runtime) setupRootlessPortMappingViaRLK(ctr *Container, netnsPath strin
ExitFD: 3,
ReadyFD: 4,
TmpDir: ctr.runtime.config.Engine.TmpDir,
- ChildIP: "10.0.2.100",
+ ChildIP: slirp4netnsIP,
}
cfgJSON, err := json.Marshal(cfg)
if err != nil {