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.
This commit is contained in:
Roman Beranek
2021-05-10 12:29:48 +02:00
committed by Lennart Poettering
parent c362a432af
commit ee3713b71d
+4 -3
View File
@@ -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) {