diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2023-06-17 15:46:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-17 15:46:06 +0200 |
commit | 04be3080921507b69899d01bc79be86181e6f536 (patch) | |
tree | afc034f5fb825100ac48cf0d1b0bc5203f254a71 /src | |
parent | ac06ba8320aebe2ee7583d9ce0b3915df6f43cbb (diff) |
Fix access to packet/flow information (#2013)
We can't access to `ndpi_str->packet` from `ndpi_detection_giveup()`
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/ndpi_main.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index fb54035fd..59f21c555 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); |