@ -461,6 +461,19 @@ namespace llarp
else
msg . AddNXReply ( ) ;
}
else if ( msg . questions [ 0 ] . IsLocalhost ( ) and msg . questions [ 0 ] . HasSubdomains ( ) )
{
const auto subdomain = msg . questions [ 0 ] . Subdomains ( ) ;
if ( subdomain = = " exit " and HasExit ( ) )
{
m_ExitMap . ForEachEntry (
[ & msg ] ( const auto & , const auto & exit ) { msg . AddCNAMEReply ( exit . ToString ( ) , 1 ) ; } ) ;
}
else
{
msg . AddNXReply ( ) ;
}
}
else if ( is_localhost_loki ( msg ) )
{
size_t counter = 0 ;
@ -501,21 +514,33 @@ namespace llarp
}
else if ( is_localhost_loki ( msg ) )
{
size_t counter = 0 ;
context - > ForEachService (
[ & ] ( const std : : string & , const std : : shared_ptr < service : : Endpoint > & service ) - > bool {
if ( ! service - > HasIfAddr ( ) )
return true ;
huint128_t ip = service - > GetIfAddr ( ) ;
if ( ip . h )
{
msg . AddINReply ( ip , isV6 ) ;
+ + counter ;
}
return true ;
} ) ;
if ( counter = = 0 )
const bool lookingForExit = msg . questions [ 0 ] . Subdomains ( ) = = " exit " ;
huint128_t ip = GetIfAddr ( ) ;
if ( ip . h )
{
if ( lookingForExit )
{
if ( HasExit ( ) )
{
m_ExitMap . ForEachEntry (
[ & msg ] ( const auto & , const auto & exit ) { msg . AddCNAMEReply ( exit . ToString ( ) ) ; } ) ;
msg . AddINReply ( ip , isV6 ) ;
}
else
{
msg . AddNXReply ( ) ;
}
}
else
{
msg . AddCNAMEReply ( m_Identity . pub . Name ( ) , 1 ) ;
msg . AddINReply ( ip , isV6 ) ;
}
}
else
{
msg . AddNXReply ( ) ;
}
}
else if ( addr . FromString ( qname , " .loki " ) )
{