ARM fixes

This commit is contained in:
Luca Deri
2021-08-25 09:46:29 +02:00
parent 88040f0449
commit 90c6fd99a7
+8 -1
View File
@@ -196,7 +196,14 @@ int quic_len(const uint8_t *buf, uint64_t *value)
*value = ntohl(*(uint32_t *)buf) & 0x3FFFFFFF;
return 4;
case 3:
*value = ndpi_ntohll(*(uint64_t *)buf) & 0x3FFFFFFFFFFFFFFF;
{
u_int64_t n;
/* Necessary as simple cast crashes on ARM */
memcpy(&n, buf, sizeof(u_int64_t));
*value = ndpi_ntohll(n & 0x3FFFFFFFFFFFFFFF);
}
return 8;
default: /* No Possible */
return 0;