From 362baa6321d09d1efe50a3d86d1f2ecab896a906 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Mon, 21 Sep 2020 21:15:52 +0200 Subject: Minor change for alignment issue --- src/lib/protocols/stun.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c index 703b46be7..e4d504821 100644 --- a/src/lib/protocols/stun.c +++ b/src/lib/protocols/stun.c @@ -147,7 +147,6 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct * const u_int8_t * payload, const u_int16_t payload_length) { u_int16_t msg_type, msg_len; - struct stun_packet_header *h = (struct stun_packet_header*)payload; int rc; /* STUN over TCP does not look good */ @@ -178,7 +177,8 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct * goto udp_stun_found; } - msg_type = ntohs(h->msg_type), msg_len = ntohs(h->msg_len); + msg_type = ntohs(*((u_int16_t*)payload)); + msg_len = ntohs(*((u_int16_t*)&payload[2])); if(msg_type == 0) return(NDPI_IS_NOT_STUN); -- cgit v1.2.3