From 0c70411b1b093279f3d7c09b2b57b491911df84c Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Sat, 29 Jan 2022 09:18:32 +0100 Subject: Make some protocols more "big-endian" friendly (#1402) See #1312 --- src/lib/ndpi_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/ndpi_main.c') diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 4c118bc03..54f03916d 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -4956,7 +4956,7 @@ static void ndpi_reconcile_protocols(struct ndpi_detection_module_struct *ndpi_s if(ndpi_str->msteams_cache) ndpi_lru_add_to_cache(ndpi_str->msteams_cache, - flow->saddr, + ntohl(flow->saddr), (flow->last_packet_time_ms / 1000) & 0xFFFF /* 16 bit */); } break; @@ -4968,7 +4968,7 @@ static void ndpi_reconcile_protocols(struct ndpi_detection_module_struct *ndpi_s && ndpi_str->msteams_cache) { u_int16_t when; - if(ndpi_lru_find_cache(ndpi_str->msteams_cache, flow->saddr, + if(ndpi_lru_find_cache(ndpi_str->msteams_cache, ntohl(flow->saddr), &when, 0 /* Don't remove it as it can be used for other connections */)) { u_int16_t tdiff = ((flow->last_packet_time_ms /1000) & 0xFFFF) - when; @@ -4978,7 +4978,7 @@ static void ndpi_reconcile_protocols(struct ndpi_detection_module_struct *ndpi_s /* Refresh cache */ ndpi_lru_add_to_cache(ndpi_str->msteams_cache, - flow->saddr, + ntohl(flow->saddr), (flow->last_packet_time_ms / 1000) & 0xFFFF /* 16 bit */); } } -- cgit v1.2.3