Merge pull request #54 from neuroscr/master

DNS QoL improvements
pull/56/head
Jeff 6 years ago committed by GitHub
commit 23c8807d59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,9 +47,10 @@ if(STATIC_LINK)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++ -static-libgcc -static" )
endif()
if(DNS_PORT)
add_definitions(-DDNS_PORT=${DNS_PORT})
endif()
# This is now configurable in ini
#if(DNS_PORT)
# add_definitions(-DDNS_PORT=${DNS_PORT})
#endif()
if(SHADOW)
set(WITH_STATIC OFF)

@ -162,7 +162,14 @@ llarp_generic_ensure_config(std::ofstream &f, std::string basepath)
f << "upstream=" << DEFAULT_RESOLVER_EU << std::endl;
f << "# opennic au resolver" << std::endl;
f << "upstream=" << DEFAULT_RESOLVER_AU << std::endl;
// Make auto-config smarter
// will this break reproducibility rules?
#ifdef __linux__
f << "bind=127.3.2.1:53" << std::endl;
#else
f << "bind=127.0.0.1:53" << std::endl;
#endif
f << std::endl << std::endl;
f << "# network database settings block " << std::endl;
@ -246,6 +253,8 @@ llarp_ensure_client_config(std::ofstream &f, std::string basepath)
f << "# network settings " << std::endl;
f << "[network]" << std::endl;
f << "profiles=" << basepath << "profiles.dat" << std::endl;
// WHAT? Why this ifndef?
#ifndef __linux__
f << "# ";
#endif

@ -9,10 +9,6 @@
#include <netdb.h>
#endif
#ifndef DNS_PORT
#define DNS_PORT (53)
#endif
namespace llarp
{
namespace handlers
@ -40,7 +36,7 @@ namespace llarp
if(k == "local-dns")
{
std::string resolverAddr = v;
uint16_t dnsport = DNS_PORT;
uint16_t dnsport = 53;
auto pos = v.find(":");
if(pos != std::string::npos)
{
@ -53,7 +49,7 @@ namespace llarp
if(k == "upstream-dns")
{
std::string resolverAddr = v;
uint16_t dnsport = DNS_PORT;
uint16_t dnsport = 53;
auto pos = v.find(":");
if(pos != std::string::npos)
{
@ -384,7 +380,7 @@ namespace llarp
{
// not found
service::Address addr;
llarp::LogWarn(ip, " not found in tun map. Sending ", addr.ToString());
llarp::LogWarn(ip, " not found in tun map.");
return addr;
}
// found

Loading…
Cancel
Save