summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-question.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-24 01:25:24 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-25 21:58:32 +0100
commit703e4f5e39c019da8c002ba10bd450ce378c0e91 (patch)
treee5d988cd7fa48e521ce4ed2708142d5ae3ed64be /src/resolve/resolved-dns-question.c
parentac7653a43314aed75ba6d9516cd596000a7355f9 (diff)
resolved: don't claim DnsQuestion have to have the same names
Wen DnsQuestion objects are used for DnsQuery objects all contained keys have to share the same name, but otherwise they generally don't have to, and this can actually happen in real-life because DnsPacket objects for mDNS use DnsQuestion for the question section. Hence, rename: dns_question_is_valid() to dns_question_is_valid_for_query(), since the name uniqueness check it does is only relevant when used for a query. Similar, rename dns_question_name() to dns_question_first_name(), to be more accurate, as this difference matters if we keys don#t have to share the same name.
Diffstat (limited to 'src/resolve/resolved-dns-question.c')
-rw-r--r--src/resolve/resolved-dns-question.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/resolve/resolved-dns-question.c b/src/resolve/resolved-dns-question.c
index 9fb3038381..b1aa0175e0 100644
--- a/src/resolve/resolved-dns-question.c
+++ b/src/resolve/resolved-dns-question.c
@@ -125,7 +125,7 @@ int dns_question_matches_cname(DnsQuestion *q, DnsResourceRecord *rr) {
return 0;
}
-int dns_question_is_valid(DnsQuestion *q) {
+int dns_question_is_valid_for_query(DnsQuestion *q) {
const char *name;
unsigned i;
int r;
@@ -274,8 +274,10 @@ int dns_question_cname_redirect(DnsQuestion *q, const DnsResourceRecord *cname,
return 1;
}
-const char *dns_question_name(DnsQuestion *q) {
- assert(q);
+const char *dns_question_first_name(DnsQuestion *q) {
+
+ if (!q)
+ return NULL;
if (q->n_keys < 1)
return NULL;