diff options
author | Luca Deri <deri@ntop.org> | 2023-07-14 19:52:34 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2023-07-14 19:52:34 +0200 |
commit | fea09e825b8c3872ea54c8361242a9eff538222c (patch) | |
tree | fc970a79bea3def70a0f42bf28e98b4c9c960ce1 /src/lib/ndpi_main.c | |
parent | abee1a2a6f1d8375831901e49ace85eaea0650e3 (diff) |
Fixes risk mask exception handling while improving the overall performance
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r-- | src/lib/ndpi_main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 65c50b6ec..ca7bdd912 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -6079,7 +6079,6 @@ static u_int32_t make_msteams_key(struct ndpi_flow_struct *flow, u_int8_t use_cl static void ndpi_reconcile_msteams_udp(struct ndpi_detection_module_struct *ndpi_str, struct ndpi_flow_struct *flow, u_int16_t master) { - /* This function can NOT access &ndpi_str->packet since it is called also from ndpi_detection_giveup(), via ndpi_reconcile_protocols() */ if(flow->l4_proto == IPPROTO_UDP) { @@ -6159,6 +6158,12 @@ static void ndpi_reconcile_protocols(struct ndpi_detection_module_struct *ndpi_s // printf("====>> %u.%u [%u]\n", ret->master_protocol, ret->app_protocol, flow->detected_protocol_stack[0]); + if((flow->risk != 0) && (flow->risk != flow->risk_shadow)) { + /* Trick to avoid evaluating exceptions when nothing changed */ + ndpi_handle_risk_exceptions(ndpi_str, flow); + flow->risk_shadow = flow->risk; + } + switch(ret->app_protocol) { case NDPI_PROTOCOL_MICROSOFT_AZURE: ndpi_reconcile_msteams_udp(ndpi_str, flow, flow->detected_protocol_stack[1]); |