aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/stun.c
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2022-01-29 09:18:32 +0100
committerGitHub <noreply@github.com>2022-01-29 09:18:32 +0100
commit0c70411b1b093279f3d7c09b2b57b491911df84c (patch)
tree993145c834d91aae2cd72044ae940f77557cf713 /src/lib/protocols/stun.c
parent86b97ffb73edc0965ee1784c8182e715c2d932e3 (diff)
Make some protocols more "big-endian" friendly (#1402)
See #1312
Diffstat (limited to 'src/lib/protocols/stun.c')
-rw-r--r--src/lib/protocols/stun.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c
index 3f9b21fbe..80c2902ca 100644
--- a/src/lib/protocols/stun.c
+++ b/src/lib/protocols/stun.c
@@ -42,9 +42,9 @@ struct stun_packet_header {
u_int32_t get_stun_lru_key(struct ndpi_packet_struct *packet, u_int8_t rev) {
if(rev)
- return(packet->iph->daddr + packet->udp->dest);
+ return(ntohl(packet->iph->daddr) + ntohs(packet->udp->dest));
else
- return(packet->iph->saddr + packet->udp->source);
+ return(ntohl(packet->iph->saddr) + ntohs(packet->udp->source));
}
/* ************************************************************ */