diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-06-20 21:28:53 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-06-21 13:20:48 +0200 |
commit | 501e8eb0549bb6c3f5d08b6f6c6ad7c6a34575ba (patch) | |
tree | 221e628bf3252fd2dfb85b429530fe28a82befe7 /src/resolve/resolved-dns-scope.c | |
parent | 17c8de633faad3ac97012e066c6c6b2f71b83a67 (diff) |
resolved: add dns_answer_is_empty() and dns_question_is_empty() helpers
And make use of them at a few places.
Diffstat (limited to 'src/resolve/resolved-dns-scope.c')
-rw-r--r-- | src/resolve/resolved-dns-scope.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/resolve/resolved-dns-scope.c b/src/resolve/resolved-dns-scope.c index 9d484d0a48..6f56148732 100644 --- a/src/resolve/resolved-dns-scope.c +++ b/src/resolve/resolved-dns-scope.c @@ -610,9 +610,9 @@ static int dns_scope_make_reply_packet( assert(s); assert(ret); - if ((!q || q->n_keys <= 0) - && (!answer || answer->n_rrs <= 0) - && (!soa || soa->n_rrs <= 0)) + if (dns_question_isempty(q) && + dns_answer_isempty(answer) && + dns_answer_isempty(soa)) return -EINVAL; r = dns_packet_new(&p, s->protocol, 0); @@ -718,7 +718,7 @@ void dns_scope_process_query(DnsScope *s, DnsStream *stream, DnsPacket *p) { return; } - assert(p->question->n_keys == 1); + assert(dns_question_size(p->question) == 1); key = p->question->keys[0]; r = dns_zone_lookup(&s->zone, key, 0, &answer, &soa, &tentative); |