aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2022-03-05 15:05:05 +0100
committerGitHub <noreply@github.com>2022-03-05 15:05:05 +0100
commitc345b3c7af89957ef4bc55e2ccf1b1a4bc724f3a (patch)
tree444d113c87e7670eaf2917e414a1694196be0e13 /src/lib/protocols
parent438f04066bb6333dcb219205a09501ee50fdd993 (diff)
EthernetIP: fix integer conversion on big-endian archs (#1477)
Diffstat (limited to 'src/lib/protocols')
-rw-r--r--src/lib/protocols/ethernet_ip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/protocols/ethernet_ip.c b/src/lib/protocols/ethernet_ip.c
index b11a05d95..73993c3e2 100644
--- a/src/lib/protocols/ethernet_ip.c
+++ b/src/lib/protocols/ethernet_ip.c
@@ -44,7 +44,7 @@ void ndpi_search_ethernet_ip(struct ndpi_detection_module_struct *ndpi_struct,
u_int16_t eth_ip_port = ntohs(44818);
if((packet->tcp->source == eth_ip_port) || (packet->tcp->dest == eth_ip_port)) {
- u_int16_t len = *((u_int16_t*)&packet->payload[2]); /* Little endian */
+ u_int16_t len = le16toh(*((u_int16_t *)&packet->payload[2])); /* Little endian */
if((len+24) == packet->payload_packet_len) {
NDPI_LOG_INFO(ndpi_struct, "found ethernet_ip\n");