From 65b9c68d7d92f615e2df5df0bb687dd7cfd7ac56 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Sat, 27 Jan 2024 20:39:47 +0100 Subject: Fixed loading of non-ICANN domains that caused false positives with ndpi_load_domain_suffixes Minor hash optimization --- src/lib/ndpi_domains.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib/ndpi_domains.c') diff --git a/src/lib/ndpi_domains.c b/src/lib/ndpi_domains.c index 3c59e3cd9..e7b283e54 100644 --- a/src/lib/ndpi_domains.c +++ b/src/lib/ndpi_domains.c @@ -47,6 +47,10 @@ int ndpi_load_domain_suffixes(struct ndpi_detection_module_struct *ndpi_str, while((line = fgets(buf, sizeof(buf), fd)) != NULL) { u_int offset, len; + + /* Skip private domains */ + if(strstr(line, "// ===END ICANN DOMAINS===")) + break; /* Skip empty lines or comments */ if((line[0] == '\0') || (line[0] == '/') || (line[0] == '\n') || (line[0] == '\r')) -- cgit v1.2.3