chiark / gitweb /
resolved: stop the prober when we detect a conflict in LLMNR
[elogind.git] / src / resolve / resolved-dns-zone.c
index 649cc5c73d2427c96af47d56e5f77c3cbabf5da2..72321d0c6b2c8db70ce65fdd26db2f28c3304a88 100644 (file)
@@ -279,14 +279,14 @@ int dns_zone_put(DnsZone *z, DnsScope *s, DnsResourceRecord *rr, bool probe) {
                 if (established)
                         i->state = DNS_ZONE_ITEM_ESTABLISHED;
                 else {
+                        i->state = DNS_ZONE_ITEM_PROBING;
+
                         r = dns_zone_item_probe_start(i);
                         if (r < 0) {
                                 dns_zone_item_remove_and_free(z, i);
                                 i = NULL;
                                 return r;
                         }
-
-                        i->state = DNS_ZONE_ITEM_PROBING;
                 }
         } else
                 i->state = DNS_ZONE_ITEM_ESTABLISHED;
@@ -496,6 +496,8 @@ void dns_zone_item_conflict(DnsZoneItem *i) {
         dns_resource_record_to_string(i->rr, &pretty);
         log_info("Detected conflict on %s", strna(pretty));
 
+        dns_zone_item_probe_stop(i);
+
         /* Withdraw the conflict item */
         i->state = DNS_ZONE_ITEM_WITHDRAWN;
 
@@ -522,7 +524,6 @@ void dns_zone_item_ready(DnsZoneItem *i) {
 
                 dns_zone_item_probe_stop(i);
                 i->state = DNS_ZONE_ITEM_ESTABLISHED;
-
         } else
                 dns_zone_item_conflict(i);
 }