policy: don't apply DNS configuration for non-active devices

Don't apply DNS configuration of non-active devices (for example
unmanaged ones which have a non-empty DNS configuration read from a
DHCP lease).

https://bugzilla.redhat.com/show_bug.cgi?id=1405431
This commit is contained in:
Beniamino Galvani 2016-12-19 11:22:00 +01:00
parent 0c5aa6e48b
commit 30a1e17cc0

View file

@ -1607,7 +1607,7 @@ device_ip4_config_changed (NMDevice *device,
* catch all the changes when the device moves to 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_ip4_config (priv->dns_manager, old_config);