From c345b3c7af89957ef4bc55e2ccf1b1a4bc724f3a Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Sat, 5 Mar 2022 15:05:05 +0100 Subject: EthernetIP: fix integer conversion on big-endian archs (#1477) --- src/lib/protocols/ethernet_ip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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"); -- cgit v1.2.3