mirror of
https://github.com/docker/docs.git
synced 2026-03-31 08:18:55 +07:00
Merge pull request #1497 from vincentbernat/fix/ipv4-forwarding-detection
runtime: correctly detect IPv4 forwarding
This commit is contained in:
10
runtime.go
10
runtime.go
@@ -241,12 +241,12 @@ func (runtime *Runtime) UpdateCapabilities(quiet bool) {
|
||||
if !runtime.capabilities.SwapLimit && !quiet {
|
||||
log.Printf("WARNING: Your kernel does not support cgroup swap limit.")
|
||||
}
|
||||
}
|
||||
|
||||
content, err3 := ioutil.ReadFile("/proc/sys/net/ipv4/ip_forward")
|
||||
runtime.capabilities.IPv4Forwarding = err3 == nil && len(content) > 0 && content[0] == '1'
|
||||
if !runtime.capabilities.IPv4Forwarding && !quiet {
|
||||
log.Printf("WARNING: IPv4 forwarding is disabled.")
|
||||
}
|
||||
content, err3 := ioutil.ReadFile("/proc/sys/net/ipv4/ip_forward")
|
||||
runtime.capabilities.IPv4Forwarding = err3 == nil && len(content) > 0 && content[0] == '1'
|
||||
if !runtime.capabilities.IPv4Forwarding && !quiet {
|
||||
log.Printf("WARNING: IPv4 forwarding is disabled.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user