diff --git a/.github/workflows/merge-conflict.yml b/.github/workflows/merge-conflict.yml index 24b299fcb..dce554074 100644 --- a/.github/workflows/merge-conflict.yml +++ b/.github/workflows/merge-conflict.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check if PRs are have merge conflicts - uses: eps1lon/actions-label-merge-conflict@v3.0.2 + uses: eps1lon/actions-label-merge-conflict@v3.0.3 with: dirtyLabel: "Merge conflicts" repoToken: "${{ secrets.GITHUB_TOKEN }}" diff --git a/src/FTL.h b/src/FTL.h index 82ae8616d..da5c7d72f 100644 --- a/src/FTL.h +++ b/src/FTL.h @@ -138,6 +138,12 @@ // Default: 30 (seconds) #define QPS_AVGLEN 30 +// How long should IPv6 client host name resolution be postponed? +// This is done to ensure that the network table had time to catch up on new +// clients in the network +// Default: 2 x database.DBinterval (seconds) = 120 s +#define DELAY_V6_RESOLUTION 2*config.database.DBinterval.v.ui + // Use out own syscalls handling functions that will detect possible errors // and report accordingly in the log. This will make debugging FTL crash // caused by insufficient memory or by code bugs (not properly dealing diff --git a/src/resolve.c b/src/resolve.c index c60797482..cede3aa25 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -895,6 +895,21 @@ static void resolveClients(const bool onlynew, const bool force_refreshing) if((ipaddr = getstr(ippos)) != NULL && strstr(ipaddr,":") != NULL) IPv6 = true; + // If onlynew flag is set, we will only resolve new clients. + // However, if this is a IPv6 client, we postpone the resolution + // slightly to ensure the network table has had time to possibly + // correlate the IPv6 address via a related other address (e.g., + // IPv4 address) though an identical MAC address. + if(onlynew && newflag && IPv6 && client->firstSeen + DELAY_V6_RESOLUTION > now) + { + log_debug(DEBUG_RESOLVER, "Postponing resolution of new client %s (IPv6) for at least %.0f more seconds", + getstr(ippos), now - client->firstSeen + DELAY_V6_RESOLUTION); + + unlock_shm(); + skipped++; + continue; + } + unlock_shm(); // If we're in refreshing mode (onlynew == false), we skip clients if