Skip to content

Commit

Permalink
Fix access to packet/flow information (ntop#2013)
Browse files Browse the repository at this point in the history
We can't access to `ndpi_str->packet` from `ndpi_detection_giveup()`
  • Loading branch information
IvanNardi authored Jun 17, 2023
1 parent ac06ba8 commit 04be308
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/lib/ndpi_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 04be308

Please sign in to comment.