From 7c4bd15ec698e960593a18bf36c8288bb011ed93 Mon Sep 17 00:00:00 2001 From: Francesco Giudici Date: Fri, 3 Mar 2017 18:03:47 +0100 Subject: [PATCH] policy: skip dns and route updates on ip6 config change signal if the device is not active This pairs with commit 30a1e17cc032676cdfb04e2abcfab9db0d0cf085. --- src/nm-policy.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/nm-policy.c b/src/nm-policy.c index 1a489d4445..2b71d13538 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -1693,8 +1693,9 @@ device_ip4_config_changed (NMDevice *device, nm_dns_manager_begin_updates (priv->dns_manager, __func__); - /* Ignore IP config changes while the device is activating, because we'll - * catch all the changes when the device moves to ACTIVATED state. + /* We catch already all the IP events registering on the device state changes but + * the ones where the IP changes but the device state keep stable (i.e., activated): + * ignore IP config changes but when the device is in activated state. * Prevents unecessary changes to DNS information. */ if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) { @@ -1728,11 +1729,12 @@ device_ip6_config_changed (NMDevice *device, nm_dns_manager_begin_updates (priv->dns_manager, __func__); - /* Ignore IP config changes while the device is activating, because we'll - * catch all the changes when the device moves to ACTIVATED state. + /* We catch already all the IP events registering on the device state changes but + * the ones where the IP changes but the device state keep stable (i.e., activated): + * ignore IP config changes but when the device is in activated state. * Prevents unecessary changes to DNS information. */ - if (!nm_device_is_activating (device)) { + if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) { if (old_config != new_config) { if (old_config) nm_dns_manager_remove_ip6_config (priv->dns_manager, old_config);