Merge pull request #30406 from yuwata/resolve-clean-exit

resolve: make resolved exit cleanly
This commit is contained in:
Luca Boccassi
2023-12-10 18:42:24 +00:00
committed by GitHub
2 changed files with 23 additions and 9 deletions
+8
View File
@@ -1428,6 +1428,14 @@ int dns_scope_announce(DnsScope *scope, bool goodbye) {
if (scope->protocol != DNS_PROTOCOL_MDNS)
return 0;
r = sd_event_get_state(scope->manager->event);
if (r < 0)
return log_debug_errno(r, "Failed to get event loop state: %m");
/* If this is called on exit, through manager_free() -> link_free(), then we cannot announce. */
if (r == SD_EVENT_FINISHED)
return 0;
/* Check if we're done with probing. */
LIST_FOREACH(transactions_by_scope, t, scope->transactions)
if (t->probing && DNS_TRANSACTION_IS_LIVE(t->state))