Make some protocols more "big-endian" friendly (#1402)

See #1312
This commit is contained in:
Ivan Nardi
2022-01-29 09:18:32 +01:00
committed by GitHub
parent 86b97ffb73
commit 0c70411b1b
7 changed files with 33 additions and 30 deletions
+3 -3
View File
@@ -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 */);
}
}