summaryrefslogtreecommitdiffstats
path: root/src/resolve
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-10-18 11:30:12 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-10-18 13:58:50 +0200
commit562f7bde8872b4fd03db11bf25c9dd294fd2c186 (patch)
treeb08a1c0fcfbc71dbc88ff66ccc21b45b5aaf8bc1 /src/resolve
parentmkosi: update opensuse commit reference and switch branch (diff)
downloadsystemd-562f7bde8872b4fd03db11bf25c9dd294fd2c186.tar.xz
systemd-562f7bde8872b4fd03db11bf25c9dd294fd2c186.zip
resolved: refresh resolv.conf files when link goes away
This might have the effect that some DNS server or search domain disappears, hence rewrite the relevant files. See: #27543
Diffstat (limited to 'src/resolve')
-rw-r--r--src/resolve/resolved-manager.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c
index e6d112964a..dbaad81734 100644
--- a/src/resolve/resolved-manager.c
+++ b/src/resolve/resolved-manager.c
@@ -97,6 +97,9 @@ static int manager_process_link(sd_netlink *rtnl, sd_netlink_message *mm, void *
log_debug("Removing link %i/%s", l->ifindex, l->ifname);
link_remove_user(l);
link_free(l);
+
+ /* Make sure DNS servers are dropped from written resolv.conf if their link goes away */
+ manager_write_resolv_conf(m);
}
break;