From 73ac6dfb8a40aef4d68e2f17aecc234bef735f02 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mon, 1 Nov 2021 11:12:01 +0100 Subject: [PATCH] policy: send ip configs to the DNS manager earlier Don't wait until the device is ACTIVATED -- pass them as soon as they're valid. They should be applied at the moment the device enters ACTIVATED state. https://bugzilla.redhat.com/show_bug.cgi?id=2006677 --- src/core/nm-policy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/nm-policy.c b/src/core/nm-policy.c index e85863611a..03e082f12f 100644 --- a/src/core/nm-policy.c +++ b/src/core/nm-policy.c @@ -2143,6 +2143,7 @@ device_ip_config_changed(NMDevice * device, NMPolicyPrivate *priv = user_data; NMPolicy * self = _PRIV_TO_SELF(priv); int addr_family; + NMDeviceState state; nm_assert(new_config || old_config); nm_assert(!new_config || NM_IS_IP_CONFIG(new_config)); @@ -2161,7 +2162,8 @@ device_ip_config_changed(NMDevice * device, * ignore IP config changes but when the device is in activated state. * Prevents unnecessary changes to DNS information. */ - if (nm_device_get_state(device) == NM_DEVICE_STATE_ACTIVATED) { + state = nm_device_get_state(device); + if (state > NM_DEVICE_STATE_IP_CONFIG && state <= NM_DEVICE_STATE_ACTIVATED) { if (old_config != new_config) { if (new_config) _dns_manager_set_ip_config(priv->dns_manager,