Merge pull request #2034 from teg/resolved-fix

minor resolved fixes
This commit is contained in:
Daniel Mack
2015-11-26 10:56:42 +01:00
2 changed files with 12 additions and 7 deletions
+9 -1
View File
@@ -298,7 +298,15 @@ static void bus_method_resolve_address_complete(DnsQuery *q) {
goto finish;
}
/* We don't process CNAME for PTR lookups. */
r = dns_query_process_cname(q);
if (r == -ELOOP) {
r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_CNAME_LOOP, "CNAME loop detected, or CNAME resolving disabled on '%s'", dns_question_name(q->question));
goto finish;
}
if (r < 0)
goto finish;
if (r > 0) /* This was a cname, and the query was restarted. */
return;
r = sd_bus_message_new_method_return(q->request, &reply);
if (r < 0)
+3 -6
View File
@@ -1746,12 +1746,9 @@ int dns_packet_read_rr(DnsPacket *p, DnsResourceRecord **ret, size_t *start) {
if (r < 0)
goto fail;
/* The types bitmap must contain at least the NSEC record itself, so an empty bitmap means
something went wrong */
if (bitmap_isclear(rr->nsec.types)) {
r = -EBADMSG;
goto fail;
}
/* We accept empty NSEC bitmaps. The bit indicating the presence of the NSEC record itself
* is redundant and in e.g., RFC4956 this fact is used to define a use for NSEC records
* without the NSEC bit set. */
break;