Fix IPv6 lookups to return empty response

The logic here wasn't quite right and was returning an A record in
response to an AAAA lookup.

This returns nothing, which is better, but not quite enough: this gives
empty responses, which produces warnings in host/dig.
pull/1173/head
Jason Rhinelander 4 years ago
parent f3d23d6fb6
commit 6715b86d51

@ -509,12 +509,14 @@ namespace llarp
else if(msg.questions[0].qtype == dns::qTypeA
|| msg.questions[0].qtype == dns::qTypeAAAA)
{
const bool isV6 =
msg.questions[0].qtype == dns::qTypeAAAA && SupportsV6();
const bool isV6 = msg.questions[0].qtype == dns::qTypeAAAA;
const bool isV4 = msg.questions[0].qtype == dns::qTypeA;
llarp::service::Address addr;
if(isV6 && !SupportsV6())
{ // empty reply but not a NXDOMAIN so that client can retry IPv4
}
// on MacOS this is a typeA query
if(is_random_snode(msg))
else if(is_random_snode(msg))
{
RouterID random;
if(Router()->GetRandomGoodRouter(random))

Loading…
Cancel
Save