From 12255e2fe049d743c4e9485294a5324f0712fcc6 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Fri, 23 Feb 2024 19:52:08 +0100 Subject: [PATCH] Fixed risk evaluation --- src/lib/ndpi_utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c index 8bd7393d3..a6596050b 100644 --- a/src/lib/ndpi_utils.c +++ b/src/lib/ndpi_utils.c @@ -2472,6 +2472,10 @@ void ndpi_set_risk(struct ndpi_detection_module_struct *ndpi_str, if(!ndpi_isset_risk(ndpi_str, flow, r)) { ndpi_risk v = 1ull << r; + /* In case there is an exception set, take it into account */ + if(flow->host_risk_mask_evaluated) + v &= flow->risk_mask; + // NDPI_SET_BIT(flow->risk, (u_int32_t)r); flow->risk |= v;