summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-scope.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/resolve/resolved-dns-scope.c')
-rw-r--r--src/resolve/resolved-dns-scope.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/resolve/resolved-dns-scope.c b/src/resolve/resolved-dns-scope.c
index 20db1fbd81..fc4ae57ce0 100644
--- a/src/resolve/resolved-dns-scope.c
+++ b/src/resolve/resolved-dns-scope.c
@@ -70,11 +70,11 @@ int dns_scope_new(Manager *m, DnsScope **ret, Link *l, DnsProtocol protocol, int
}
static void dns_scope_abort_transactions(DnsScope *s) {
- DnsTransaction *t;
-
assert(s);
- while ((t = hashmap_first(s->transactions))) {
+ while (s->transactions) {
+ DnsTransaction *t = s->transactions;
+
/* Abort the transaction, but make sure it is not
* freed while we still look at it */
@@ -100,7 +100,7 @@ DnsScope* dns_scope_free(DnsScope *s) {
while (s->query_candidates)
dns_query_candidate_free(s->query_candidates);
- hashmap_free(s->transactions);
+ hashmap_free(s->transactions_by_key);
while ((rr = ordered_hashmap_steal_first(s->conflict_queue)))
dns_resource_record_unref(rr);
@@ -653,7 +653,7 @@ DnsTransaction *dns_scope_find_transaction(DnsScope *scope, DnsResourceKey *key,
/* Try to find an ongoing transaction that is a equal to the
* specified question */
- t = hashmap_get(scope->transactions, key);
+ t = hashmap_get(scope->transactions_by_key, key);
if (!t)
return NULL;
@@ -661,7 +661,7 @@ DnsTransaction *dns_scope_find_transaction(DnsScope *scope, DnsResourceKey *key,
* data instead of a real packet, if that's requested. */
if (!cache_ok &&
IN_SET(t->state, DNS_TRANSACTION_SUCCESS, DNS_TRANSACTION_FAILURE) &&
- !t->received)
+ t->answer_source != DNS_TRANSACTION_NETWORK)
return NULL;
return t;