summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-10-23 14:27:08 +0200
committerThomas Haller <thaller@redhat.com>2017-10-23 17:53:22 +0200
commitf3ad6790a73b4d99b5e6afd4c750e5fc161cb4b8 (patch)
tree5bbb888809255de43092dbcc2c41625908b67d4f
parent473e0f48fe7b88104ae0827431dd0092ad559e1f (diff)
downloadNetworkManager-f3ad6790a73b4d99b5e6afd4c750e5fc161cb4b8.tar.gz
platform: suppress logging error on failure to set MTU
-rw-r--r--src/platform/nm-linux-platform.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index 7b2ac003ea..6071826ab7 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -3027,8 +3027,17 @@ sysctl_set (NMPlatform *platform, const char *pathid, int dirfd, const char *pat
}
}
if (nwrote == -1 && errsv != EEXIST) {
- _LOGE ("sysctl: failed to set '%s' to '%s': (%d) %s",
- path, value, errsv, strerror (errsv));
+ NMLogLevel level = LOGL_ERR;
+
+ if ( errsv == EINVAL
+ && nm_utils_sysctl_ip_conf_is_path (AF_INET6, path, NULL, "mtu")) {
+ /* setting the MTU can fail under regular conditions. Suppress
+ * logging a warning. */
+ level = LOGL_DEBUG;
+ }
+
+ _NMLOG (level, "sysctl: failed to set '%s' to '%s': (%d) %s",
+ path, value, errsv, strerror (errsv));
} else if (nwrote < len - 1) {
_LOGE ("sysctl: failed to set '%s' to '%s' after three attempts",
path, value);