core/dns: emit CONFIG_CHANGED signal even if caching

With systemd-resolved, NetworkManager considers `/etc/resolv.conf`
unmanaged. This breaks hostname lookups in a subtle way: when a new
connection comes online, NM will initiate the hostname lookup *before*
propagating DNS updates to systemd-resolved, which of course will cause
the request to fail. And because NM doesn't update `/etc/resolv.conf`,
it doesn't emit a `CONFIG_CHANGED` signal which would've restarted the
lookup.

Fix this by emitting a signal also when using a caching DNS plugin.

https://bugzilla.redhat.com/show_bug.cgi?id=1933863

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/770
(cherry picked from commit 1c0932a6e6)
This commit is contained in:
Jonathan Lebon 2021-03-04 09:21:24 -05:00 committed by Thomas Haller
parent a1223606fb
commit 53473d0b79
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -1815,8 +1815,8 @@ plugin_skip:;
NM_DNS_MANAGER_RESOLV_CONF_MAN_UNMANAGED);
}
/* signal that resolv.conf was changed */
if (do_update && result == SR_SUCCESS)
/* signal that DNS resolution configs were changed */
if ((do_update || caching) && result == SR_SUCCESS)
g_signal_emit(self, signals[CONFIG_CHANGED], 0);
nm_clear_pointer(&priv->config_variant, g_variant_unref);