mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #1497 from vincentbernat/fix/ipv4-forwarding-detection
runtime: correctly detect IPv4 forwarding
This commit is contained in:
commit
3f95d1b9bf
1 changed files with 5 additions and 5 deletions
|
@ -241,6 +241,7 @@ 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'
|
||||||
|
@ -248,7 +249,6 @@ func (runtime *Runtime) UpdateCapabilities(quiet bool) {
|
||||||
log.Printf("WARNING: IPv4 forwarding is disabled.")
|
log.Printf("WARNING: IPv4 forwarding is disabled.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME: harmonize with NewGraph()
|
// FIXME: harmonize with NewGraph()
|
||||||
func NewRuntime(flGraphPath string, autoRestart bool, dns []string) (*Runtime, error) {
|
func NewRuntime(flGraphPath string, autoRestart bool, dns []string) (*Runtime, error) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue