mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
runtime: correctly detect IPv4 forwarding
When memory cgroup is absent, there was not attempt to detect if IPv4 forwarding was enabled and therefore, docker was printing a warning for each command spawning a new container. The test for IPv4 forwarding was guarded by the test for memory cgroup.
This commit is contained in:
parent
940d58806c
commit
64b817a5c1
1 changed files with 5 additions and 5 deletions
10
runtime.go
10
runtime.go
|
@ -241,12 +241,12 @@ func (runtime *Runtime) UpdateCapabilities(quiet bool) {
|
||||||
if !runtime.capabilities.SwapLimit && !quiet {
|
if !runtime.capabilities.SwapLimit && !quiet {
|
||||||
log.Printf("WARNING: Your kernel does not support cgroup swap limit.")
|
log.Printf("WARNING: Your kernel does not support cgroup swap limit.")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
content, err3 := ioutil.ReadFile("/proc/sys/net/ipv4/ip_forward")
|
content, err3 := ioutil.ReadFile("/proc/sys/net/ipv4/ip_forward")
|
||||||
runtime.capabilities.IPv4Forwarding = err3 == nil && len(content) > 0 && content[0] == '1'
|
runtime.capabilities.IPv4Forwarding = err3 == nil && len(content) > 0 && content[0] == '1'
|
||||||
if !runtime.capabilities.IPv4Forwarding && !quiet {
|
if !runtime.capabilities.IPv4Forwarding && !quiet {
|
||||||
log.Printf("WARNING: IPv4 forwarding is disabled.")
|
log.Printf("WARNING: IPv4 forwarding is disabled.")
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue