diff --git a/include/llarp/dns_iptracker.hpp b/include/llarp/dns_iptracker.hpp index 66b72fa4a..87e6f5ae4 100644 --- a/include/llarp/dns_iptracker.hpp +++ b/include/llarp/dns_iptracker.hpp @@ -11,8 +11,7 @@ // neither, it's a result set row struct dns_pointer { - // FIXME change to llarp::Addr - struct sockaddr *hostResult; + llarp::Addr hostResult; llarp::service::Address b32addr; // we could store the timeout at which we expect it to be available // or a list of pending requests for it @@ -22,7 +21,6 @@ struct ip_range { uint8_t octet2; uint8_t octet3; - // FIXME: we're not consecutive uint8_t left; std::unordered_map< uint8_t, dns_pointer * > used; }; diff --git a/llarp/dns_iptracker.cpp b/llarp/dns_iptracker.cpp index 602628d3a..5011838dd 100644 --- a/llarp/dns_iptracker.cpp +++ b/llarp/dns_iptracker.cpp @@ -47,8 +47,8 @@ dns_iptracker_setup(llarp::Addr tunGatewayIp) range->left = 252; // 4th octet, probably 1, set it struct dns_pointer *result = new dns_pointer; - result->hostResult = new sockaddr; - tunGatewayIp.CopyInto(result->hostResult); + result->hostResult = tunGatewayIp; + // tunGatewayIp.CopyInto(result->hostResult); // result->b32addr = ; // FIXME: should be our HS addr range->used[ip[3]] = result; // claim tun IP @@ -86,8 +86,9 @@ dns_iptracker_allocate_range(std::unique_ptr< ip_range > &range, uint8_t first) llarp::Addr ip(first, range->octet2, range->octet3, range->left + 2); // why plus 2? to start at .2 llarp::LogDebug("Allocated ", ip); - result->hostResult = new sockaddr; - ip.CopyInto(result->hostResult); + // result->hostResult = new sockaddr; + // ip.CopyInto(result->hostResult); + result->hostResult = ip; // make an address and place into this sockaddr range->used[range->left + 2] = result;