From: Lennart Poettering Date: Fri, 21 Aug 2015 20:59:38 +0000 (+0200) Subject: resolved: always split up questions into per-RR transactions X-Git-Tag: v225~35^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=26b1c471cdddedf1bb9aebf10f4c3073bdf7a29e;p=thirdparty%2Fsystemd.git resolved: always split up questions into per-RR transactions We do so for Unicast DNS and LLMNR anyway, let's also do this for mDNS, and simplify things. --- diff --git a/src/resolve/resolved-dns-query.c b/src/resolve/resolved-dns-query.c index bfa5a08ab34..d9f5b342b2e 100644 --- a/src/resolve/resolved-dns-query.c +++ b/src/resolve/resolved-dns-query.c @@ -143,6 +143,7 @@ static int dns_query_add_transaction(DnsQuery *q, DnsScope *s, DnsResourceKey *k assert(q); assert(s); + assert(key); r = set_ensure_allocated(&q->transactions, NULL); if (r < 0) @@ -177,27 +178,18 @@ gc: } static int dns_query_add_transaction_split(DnsQuery *q, DnsScope *s) { + unsigned i; int r; assert(q); assert(s); - if (s->protocol == DNS_PROTOCOL_MDNS) { - r = dns_query_add_transaction(q, s, NULL); + /* Create one transaction per question key */ + + for (i = 0; i < q->question->n_keys; i++) { + r = dns_query_add_transaction(q, s, q->question->keys[i]); if (r < 0) return r; - } else { - unsigned i; - - /* On DNS and LLMNR we can only send a single - * question per datagram, hence issue multiple - * transactions. */ - - for (i = 0; i < q->question->n_keys; i++) { - r = dns_query_add_transaction(q, s, q->question->keys[i]); - if (r < 0) - return r; - } } return 0;