aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/dns.c
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2025-04-10 12:44:15 +0200
committerGitHub <noreply@github.com>2025-04-10 12:44:15 +0200
commit21bbf836051feae4e50d71c926c6f9f239230393 (patch)
tree7846465676adec65a5dd67e24fbd1609294cb7d4 /src/lib/protocols/dns.c
parent3e2d69b92ad96315ec76f1e1a5a858f53ab831e8 (diff)
FPC: save all addresses from DNS to `fpc_dns` cache (#2792)
Diffstat (limited to 'src/lib/protocols/dns.c')
-rw-r--r--src/lib/protocols/dns.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/protocols/dns.c b/src/lib/protocols/dns.c
index 9acc49216..c55e1e614 100644
--- a/src/lib/protocols/dns.c
+++ b/src/lib/protocols/dns.c
@@ -444,9 +444,8 @@ static int process_answers(struct ndpi_detection_module_struct *ndpi_struct,
found = 1;
}
- /* Add to FPC DNS cache */
- if(flow->protos.dns.num_rsp_addr == 1 && /* Only the first one */
- ndpi_struct->cfg.fpc_enabled &&
+ /* Add (all addresses) to FPC DNS cache */
+ if(ndpi_struct->cfg.fpc_enabled &&
proto->app_protocol != NDPI_PROTOCOL_UNKNOWN &&
proto->app_protocol != proto->master_protocol &&
ndpi_struct->fpc_dns_cache) {
@@ -454,6 +453,9 @@ static int process_answers(struct ndpi_detection_module_struct *ndpi_struct,
fpc_dns_cache_key_from_packet(packet->payload + x, data_len),
proto->app_protocol,
ndpi_get_current_time(flow));
+
+ NDPI_LOG_DBG(ndpi_struct, "Adding entry to fpc_dns: %s proto %d\n",
+ data_len == 4 ? "ipv4" : "ipv6", proto->app_protocol);
}
}