Fixed loading of non-ICANN domains that caused false positives with ndpi_load_domain_suffixes

Minor hash optimization
This commit is contained in:
Luca Deri
2024-01-27 20:40:27 +01:00
parent bcca89b78c
commit 65b9c68d7d
4 changed files with 37 additions and 21 deletions
+4
View File
@@ -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'))