From ee3713b71ddf182852a399953968a2b39af22104 Mon Sep 17 00:00:00 2001 From: Roman Beranek Date: Fri, 30 Apr 2021 15:51:44 +0200 Subject: resolve: remove RRs from zones before an update During an update of RRs, the records of each DNS-SD service are replaced with new ones. However the old RRs can only be removed from the mDNS scopes as long as they remain accessible from the DnssdService structures, otherwise they remain stuck there. Therefore the removal must take place before the update. --- src/resolve/resolved-manager.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/resolve/resolved-manager.c') diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index 21154a7f85..4001be23e7 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -1141,15 +1141,16 @@ void manager_refresh_rrs(Manager *m) { m->mdns_host_ipv4_key = dns_resource_key_unref(m->mdns_host_ipv4_key); m->mdns_host_ipv6_key = dns_resource_key_unref(m->mdns_host_ipv6_key); + HASHMAP_FOREACH(l, m->links) + link_add_rrs(l, true); + if (m->mdns_support == RESOLVE_SUPPORT_YES) HASHMAP_FOREACH(s, m->dnssd_services) if (dnssd_update_rrs(s) < 0) log_warning("Failed to refresh DNS-SD service '%s'", s->name); - HASHMAP_FOREACH(l, m->links) { - link_add_rrs(l, true); + HASHMAP_FOREACH(l, m->links) link_add_rrs(l, false); - } } static int manager_next_random_name(const char *old, char **ret_new) { -- cgit v1.2.1