|
|
|
@ -224,13 +224,13 @@ generic_handle_dnsc_recvfrom(dnsc_answer_request *request,
|
|
|
|
|
for(uint32_t i = 0; i < hdr->qdCount; i++)
|
|
|
|
|
{
|
|
|
|
|
question = decode_question(castBufc, &pos);
|
|
|
|
|
// llarp::LogDebug("Read a question, now at ", std::to_string(pos));
|
|
|
|
|
//llarp::LogDebug("Read a question, now at ", std::to_string(pos));
|
|
|
|
|
// 1 dot: 1 byte for length + length
|
|
|
|
|
// 4 bytes for class/type
|
|
|
|
|
// castBuf += question->name.length() + 1 + 4;
|
|
|
|
|
// castBuf += 2; // skip answer label
|
|
|
|
|
}
|
|
|
|
|
llarp::LogInfo("Question ", std::to_string(question->type), " ", question->name);
|
|
|
|
|
llarp::LogDebug("Question ", std::to_string(question->type), " ", question->name);
|
|
|
|
|
|
|
|
|
|
// FIXME: only handling one atm
|
|
|
|
|
std::vector< dns_msg_answer * > answers;
|
|
|
|
@ -352,9 +352,9 @@ generic_handle_dnsc_recvfrom(dnsc_answer_request *request,
|
|
|
|
|
request->resolved(request);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(answer->type == 5)
|
|
|
|
|
if(answer->type == 5 || answer->type == 2)
|
|
|
|
|
{
|
|
|
|
|
llarp::LogInfo("Last answer is a cname, advancing to first");
|
|
|
|
|
llarp::LogDebug("Last answer is a cname/NS, reverting to first");
|
|
|
|
|
answer = answers.front();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|