aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/ndpi_api.h2
-rw-r--r--src/lib/ndpi_utils.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h
index ea40927bf..73d30de43 100644
--- a/src/include/ndpi_api.h
+++ b/src/include/ndpi_api.h
@@ -1,7 +1,7 @@
/*
* ndpi_api.h
*
- * Copyright (C) 2011-20 - ntop.org
+ * Copyright (C) 2011-24 - ntop.org
*
* This file is part of nDPI, an open source deep packet inspection
* library based on the OpenDPI and PACE technology by ipoque GmbH
diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c
index 17e15b839..fec1c7568 100644
--- a/src/lib/ndpi_utils.c
+++ b/src/lib/ndpi_utils.c
@@ -2458,7 +2458,7 @@ void ndpi_handle_risk_exceptions(struct ndpi_detection_module_struct *ndpi_str,
if(host && (host[0] != '\0')) {
/* Check host exception */
ndpi_check_hostname_risk_exception(ndpi_str, flow, host);
-
+
if(flow->risk_mask == 0) {
u_int i;
@@ -2471,6 +2471,8 @@ void ndpi_handle_risk_exceptions(struct ndpi_detection_module_struct *ndpi_str,
ndpi_free(flow->risk_infos[i].info);
flow->risk_infos[i].info = NULL;
}
+
+ flow->risk_infos[i].id = NDPI_NO_RISK;
}
flow->num_risk_infos = 0;
@@ -2507,6 +2509,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;