summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-question.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/resolve/resolved-dns-question.c')
-rw-r--r--src/resolve/resolved-dns-question.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-question.c b/src/resolve/resolved-dns-question.c
index 026a67d7b3..056bd6eb64 100644
--- a/src/resolve/resolved-dns-question.c
+++ b/src/resolve/resolved-dns-question.c
@@ -65,9 +65,20 @@ DnsQuestion *dns_question_unref(DnsQuestion *q) {
}
int dns_question_add(DnsQuestion *q, DnsResourceKey *key) {
+ unsigned i;
+ int r;
+
assert(q);
assert(key);
+ for (i = 0; i < q->n_keys; i++) {
+ r = dns_resource_key_equal(q->keys[i], key);
+ if (r < 0)
+ return r;
+ if (r > 0)
+ return 0;
+ }
+
if (q->n_keys >= q->n_allocated)
return -ENOSPC;