Skip to content

Commit

Permalink
Exclude new IPv6 clients from skipping due to the setting of resolver…
Browse files Browse the repository at this point in the history
….refreshNames as we are not refreshing but resolving for the first time here

Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Mar 1, 2025
1 parent d154623 commit 4f614ab
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/resolve.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ static size_t resolveAndAddHostname(const int udp_sock, struct sockaddr_in *dest
// Resolve client host names
static void resolveClients(const bool onlynew, const bool force_refreshing)
{
const time_t now = time(NULL);
const double now = double_time();
// Lock counter access here, we use a copy in the following loop
lock_shm();
const unsigned int clientscount = counters->clients;
Expand Down Expand Up @@ -962,7 +962,14 @@ static void resolveClients(const bool onlynew, const bool force_refreshing)
// 2. We should only refresh IPv4 client, but this client is IPv6
// 3. We should only refresh unknown hostnames, but leave
// existing ones as they are
if(onlynew == false &&
//
// We do not skip here clients which are
// - still new,
// - IPv6, and
// - need to be resolved
const bool new_ipv6_needs_resolve = newflag && IPv6 && client->firstSeen + DELAY_V6_RESOLUTION <= now;

if(onlynew == false && !new_ipv6_needs_resolve &&
(config.resolver.refreshNames.v.refresh_hostnames == REFRESH_NONE ||
(config.resolver.refreshNames.v.refresh_hostnames == REFRESH_IPV4_ONLY && IPv6) ||
(config.resolver.refreshNames.v.refresh_hostnames == REFRESH_UNKNOWN && oldnamepos != 0)))
Expand Down

0 comments on commit 4f614ab

Please sign in to comment.