From dab6e90f7dec51cbf2aa0abb9d15d9d57f012132 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Mon, 11 Dec 2023 15:03:52 -0400 Subject: [PATCH] Fix version encoding We are reinterpret_cast'ing the version to a string to send it as raw bytes, but it was sending \x00\x00\x09 instead of \x00\x09\x0a because the version constant was actually a uint16_t array. This just makes the version constant a uint8_t array instead so that it works (and I am not at all worried about any version component getting larger than 255). --- llarp/constants/version.cpp.in | 2 +- llarp/constants/version.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llarp/constants/version.cpp.in b/llarp/constants/version.cpp.in index 3c57aa0ef..e2e095147 100644 --- a/llarp/constants/version.cpp.in +++ b/llarp/constants/version.cpp.in @@ -4,7 +4,7 @@ namespace llarp { // clang-format off - const std::array LOKINET_VERSION{{@lokinet_VERSION_MAJOR@, @lokinet_VERSION_MINOR@, @lokinet_VERSION_PATCH@}}; + const std::array LOKINET_VERSION{{@lokinet_VERSION_MAJOR@, @lokinet_VERSION_MINOR@, @lokinet_VERSION_PATCH@}}; const char* const LOKINET_VERSION_TAG = "@VERSIONTAG@"; const char* const LOKINET_VERSION_FULL = "lokinet-@lokinet_VERSION_MAJOR@.@lokinet_VERSION_MINOR@.@lokinet_VERSION_PATCH@-@LOKINET_VERSION_TAG@"; diff --git a/llarp/constants/version.hpp b/llarp/constants/version.hpp index 31c2ebee2..bd83bdde6 100644 --- a/llarp/constants/version.hpp +++ b/llarp/constants/version.hpp @@ -6,7 +6,7 @@ namespace llarp { // Given a full lokinet version of: lokinet-1.2.3-abc these are: - extern const std::array LOKINET_VERSION; + extern const std::array LOKINET_VERSION; extern const char* const LOKINET_VERSION_TAG; extern const char* const LOKINET_VERSION_FULL;