From 04bd4a9ea53fe9f60eaa1949cb2d79b866e813f9 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 6 Aug 2013 11:03:28 -0400 Subject: [PATCH] core: don't log warnings when devices are removed If a device is removed, then trying to reset its IPv6 state will cause nm_utils_do_sysctl() to log a warning since the path no longer exists. So don't try to do it in that case. --- src/devices/nm-device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index ee3d61905..b0f12b036 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -4861,14 +4861,16 @@ dispose (GObject *object) g_clear_object (&priv->vpn6_config); /* reset the saved RA value */ - if (priv->ip6_accept_ra_path) { + if ( priv->ip6_accept_ra_path + && g_file_test (priv->ip6_accept_ra_path, G_FILE_TEST_EXISTS)) { nm_utils_do_sysctl (priv->ip6_accept_ra_path, priv->ip6_accept_ra_save ? "1" : "0"); } g_free (priv->ip6_accept_ra_path); /* reset the saved use_tempaddr value */ - if (priv->ip6_privacy_tempaddr_path) { + if ( priv->ip6_privacy_tempaddr_path + && g_file_test (priv->ip6_privacy_tempaddr_path, G_FILE_TEST_EXISTS)) { char tmp[16]; snprintf (tmp, sizeof (tmp), "%d", priv->ip6_privacy_tempaddr_save);