From 27f34593eac04fa5e43a540eb13b20d739169140 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 20 May 2016 17:39:05 +0200 Subject: [PATCH] Suppress "IPv4 forwarding" warning for --net=none There's no need to warn that "ip-forwarding" is disabled if a container doesn't use networking. Signed-off-by: Sebastiaan van Stijn --- daemon/daemon_unix.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index 768d91f91d..2392165002 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -489,8 +489,8 @@ func verifyPlatformContainerSettings(daemon *Daemon, hostConfig *containertypes. return warnings, fmt.Errorf("Invalid value %d, range for oom score adj is [-1000, 1000]", hostConfig.OomScoreAdj) } - // ip-forwarding does not affect container with '--net=host' - if sysInfo.IPv4ForwardingDisabled && !hostConfig.NetworkMode.IsHost() { + // ip-forwarding does not affect container with '--net=host' (or '--net=none') + if sysInfo.IPv4ForwardingDisabled && !(hostConfig.NetworkMode.IsHost() || hostConfig.NetworkMode.IsNone()) { warnings = append(warnings, "IPv4 forwarding is disabled. Networking will not work.") logrus.Warnf("IPv4 forwarding is disabled. Networking will not work") }