diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-03-21 03:37:04 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-03-23 13:30:23 +0100 |
commit | 9fffe0a912d566f433483f1505caf7f8f59767a5 (patch) | |
tree | fd0092b545c3d71ea561e855e3df92703c24bdfb /src/resolve | |
parent | resolve: use dns_answer_size() and dns_answer_isempty() (diff) | |
download | systemd-9fffe0a912d566f433483f1505caf7f8f59767a5.tar.xz systemd-9fffe0a912d566f433483f1505caf7f8f59767a5.zip |
resolve: dns_answer_contains() does not return negative errno
Diffstat (limited to 'src/resolve')
-rw-r--r-- | src/resolve/resolved-dns-answer.c | 4 | ||||
-rw-r--r-- | src/resolve/resolved-dns-answer.h | 4 | ||||
-rw-r--r-- | src/resolve/resolved-dns-transaction.c | 8 |
3 files changed, 5 insertions, 11 deletions
diff --git a/src/resolve/resolved-dns-answer.c b/src/resolve/resolved-dns-answer.c index a032ac157e..978d14818a 100644 --- a/src/resolve/resolved-dns-answer.c +++ b/src/resolve/resolved-dns-answer.c @@ -277,7 +277,7 @@ int dns_answer_match_key(DnsAnswer *a, const DnsResourceKey *key, DnsAnswerFlags return found; } -int dns_answer_contains_nsec_or_nsec3(DnsAnswer *a) { +bool dns_answer_contains_nsec_or_nsec3(DnsAnswer *a) { DnsResourceRecord *i; DNS_ANSWER_FOREACH(i, a) @@ -314,7 +314,7 @@ int dns_answer_contains_zone_nsec3(DnsAnswer *answer, const char *zone) { return false; } -int dns_answer_contains(DnsAnswer *answer, DnsResourceRecord *rr) { +bool dns_answer_contains(DnsAnswer *answer, DnsResourceRecord *rr) { DnsResourceRecord *i; DNS_ANSWER_FOREACH(i, answer) diff --git a/src/resolve/resolved-dns-answer.h b/src/resolve/resolved-dns-answer.h index 7ecd8606bd..3eb573b2c1 100644 --- a/src/resolve/resolved-dns-answer.h +++ b/src/resolve/resolved-dns-answer.h @@ -51,9 +51,9 @@ int dns_answer_add_extend(DnsAnswer **a, DnsResourceRecord *rr, int ifindex, Dns int dns_answer_add_soa(DnsAnswer *a, const char *name, uint32_t ttl, int ifindex); int dns_answer_match_key(DnsAnswer *a, const DnsResourceKey *key, DnsAnswerFlags *ret_flags); -int dns_answer_contains_nsec_or_nsec3(DnsAnswer *a); +bool dns_answer_contains_nsec_or_nsec3(DnsAnswer *a); int dns_answer_contains_zone_nsec3(DnsAnswer *answer, const char *zone); -int dns_answer_contains(DnsAnswer *answer, DnsResourceRecord *rr); +bool dns_answer_contains(DnsAnswer *answer, DnsResourceRecord *rr); int dns_answer_find_soa(DnsAnswer *a, const DnsResourceKey *key, DnsResourceRecord **ret, DnsAnswerFlags *ret_flags); int dns_answer_find_cname_or_dname(DnsAnswer *a, const DnsResourceKey *key, DnsResourceRecord **ret, DnsAnswerFlags *ret_flags); diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c index 6eac7e9c57..c97b0846a8 100644 --- a/src/resolve/resolved-dns-transaction.c +++ b/src/resolve/resolved-dns-transaction.c @@ -2222,13 +2222,7 @@ static int dns_transaction_has_unsigned_negative_answer(DnsTransaction *t) { * question. If so, let's see if there are any NSEC/NSEC3 RRs * included. If not, the answer is unsigned. */ - r = dns_answer_contains_nsec_or_nsec3(t->answer); - if (r < 0) - return r; - if (r > 0) - return false; - - return true; + return !dns_answer_contains_nsec_or_nsec3(t->answer); } static int dns_transaction_is_primary_response(DnsTransaction *t, DnsResourceRecord *rr) { |