mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-14 09:38:04 +02:00
dns: on quit only update resolv.conf if dns=dnsmasq
Previously we always updated resolv.conf on quit. When we are using systemd-resolved the update is not necessary because the resolver on 127.0.0.53 would still be reachable after NM quits. Also, when NM manages resolv.conf directly there is no need to update the file again. Let's rewrite resolv.conf only when using dnsmasq. https://bugzilla.redhat.com/show_bug.cgi?id=1541031
This commit is contained in:
parent
cd6cf0ea36
commit
37eed6984b
1 changed files with 6 additions and 4 deletions
|
|
@ -1556,11 +1556,13 @@ nm_dns_manager_stop (NMDnsManager *self)
|
|||
_LOGT ("stopping...");
|
||||
|
||||
/* If we're quitting, leave a valid resolv.conf in place, not one
|
||||
* pointing to 127.0.0.1 if any plugins were active. Thus update
|
||||
* DNS after disposing of all plugins. But if we haven't done any
|
||||
* DNS updates yet, there's no reason to touch resolv.conf on shutdown.
|
||||
* pointing to 127.0.0.1 if dnsmasq was active. But if we haven't
|
||||
* done any DNS updates yet, there's no reason to touch resolv.conf
|
||||
* on shutdown.
|
||||
*/
|
||||
if (priv->dns_touched) {
|
||||
if ( priv->dns_touched
|
||||
&& priv->plugin
|
||||
&& NM_IS_DNS_DNSMASQ (priv->plugin)) {
|
||||
if (!update_dns (self, TRUE, &error)) {
|
||||
_LOGW ("could not commit DNS changes on shutdown: %s", error->message);
|
||||
g_clear_error (&error);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue