From bdb266f039ac800a0eaf89876014c5e856eb116d Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 22 Jan 2024 11:40:51 +0100 Subject: [PATCH] parser: fix detected IPv4 and IPv6 byte order Signed-off-by: Simon Rozman --- include/stdex/parser.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/stdex/parser.hpp b/include/stdex/parser.hpp index 06e56c096..2b3df07ca 100644 --- a/include/stdex/parser.hpp +++ b/include/stdex/parser.hpp @@ -2457,6 +2457,7 @@ namespace stdex if (i < 4) goto error; + value.s_addr = htonl(value.s_addr); this->interval.start = start; return true; @@ -2720,7 +2721,7 @@ namespace stdex goto error; } components[i].end = this->interval.end; - this->value.s6_words[i] = (uint16_t)x; + this->value.s6_words[i] = htons((uint16_t)x); } if (compaction_i != SIZE_MAX) {