diff options
author | Ronan Pigott <ronan@rjp.ie> | 2024-03-26 19:00:44 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-03-27 02:16:38 +0100 |
commit | 400171036592c4e3debc5b123e406155764f987d (patch) | |
tree | 1a21b8bd8d5790bc0e211b2b94dfb4db66a1f78c /src/resolve | |
parent | shared/logs-show: restore infinite loop avoidance for corrupted journals (diff) | |
download | systemd-400171036592c4e3debc5b123e406155764f987d.tar.xz systemd-400171036592c4e3debc5b123e406155764f987d.zip |
resolved: minor dnssec fixups
Fixes: ce5b9d5b3c24 ("resolved: request DS with DNSKEY")
Diffstat (limited to 'src/resolve')
-rw-r--r-- | src/resolve/resolved-dns-transaction.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c index 2e3af0c445..78f370c7c1 100644 --- a/src/resolve/resolved-dns-transaction.c +++ b/src/resolve/resolved-dns-transaction.c @@ -2318,13 +2318,18 @@ static int dns_transaction_request_dnssec_rr_full(DnsTransaction *t, DnsResource if (r < 0) return r; + if (ret) + *ret = NULL; return 0; } /* This didn't work, ask for it via the network/cache then. */ r = dns_transaction_add_dnssec_transaction(t, key, &aux); - if (r == -ELOOP) /* This would result in a cyclic dependency */ + if (r == -ELOOP) { /* This would result in a cyclic dependency */ + if (ret) + *ret = NULL; return 0; + } if (r < 0) return r; @@ -2490,7 +2495,7 @@ int dns_transaction_request_dnssec_keys(DnsTransaction *t) { case DNS_TYPE_RRSIG: { /* For each RRSIG we request the matching DNSKEY */ _cleanup_(dns_resource_key_unrefp) DnsResourceKey *dnskey = NULL; - DnsTransaction *aux = NULL; + DnsTransaction *aux; /* If this RRSIG is about a DNSKEY RR and the * signer is the same as the owner, then we @@ -2537,6 +2542,8 @@ int dns_transaction_request_dnssec_keys(DnsTransaction *t) { if (aux) { _cleanup_(dns_resource_key_unrefp) DnsResourceKey *ds = dns_resource_key_new(rr->key->class, DNS_TYPE_DS, dns_resource_key_name(dnskey)); + if (!ds) + return -ENOMEM; r = dns_transaction_request_dnssec_rr(t, ds); if (r < 0) return r; |