From 04be3080921507b69899d01bc79be86181e6f536 Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Sat, 17 Jun 2023 15:46:06 +0200 Subject: [PATCH] Fix access to packet/flow information (#2013) We can't access to `ndpi_str->packet` from `ndpi_detection_giveup()` --- src/lib/ndpi_main.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index fb54035fdb7..59f21c555ba 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -6101,11 +6101,9 @@ static int ndpi_reconcile_msteams_call_udp_port(struct ndpi_detection_module_str static void ndpi_reconcile_msteams_call_udp(struct ndpi_detection_module_struct *ndpi_str, struct ndpi_flow_struct *flow) { if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_SKYPE_TEAMS_CALL) { - struct ndpi_packet_struct *packet = &ndpi_str->packet; - - if((packet != NULL) && (packet->udp != NULL)) { - u_int16_t sport = ntohs(packet->udp->source); - u_int16_t dport = ntohs(packet->udp->dest); + if(flow->l4_proto == IPPROTO_UDP) { + u_int16_t sport = ntohs(flow->c_port); + u_int16_t dport = ntohs(flow->s_port); if(ndpi_reconcile_msteams_call_udp_port(ndpi_str, flow, sport, dport) == 0) ndpi_reconcile_msteams_call_udp_port(ndpi_str, flow, dport, sport);