diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2022-01-29 09:18:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-29 09:18:32 +0100 |
commit | 0c70411b1b093279f3d7c09b2b57b491911df84c (patch) | |
tree | 993145c834d91aae2cd72044ae940f77557cf713 /src/lib/ndpi_main.c | |
parent | 86b97ffb73edc0965ee1784c8182e715c2d932e3 (diff) |
Make some protocols more "big-endian" friendly (#1402)
See #1312
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r-- | src/lib/ndpi_main.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 */); } } |