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.
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) {