]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: remove RRs from zones before an update
authorRoman Beranek <roman.beranek@prusa3d.com>
Fri, 30 Apr 2021 13:51:44 +0000 (15:51 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 10 May 2021 10:29:48 +0000 (12:29 +0200)
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

index 21154a7f85eb5acb672a85917293a78b6cdf8bdf..4001be23e7ffdd25c325b8f65b8800767de79e40 100644 (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) {