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).
This commit is contained in:
Jason Rhinelander 2023-12-11 15:03:52 -04:00
parent 4c1f6112a7
commit 1a7f47f5cd
No known key found for this signature in database
GPG Key ID: C4992CE7A88D4262
2 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@
namespace llarp
{
// clang-format off
const std::array<uint16_t, 3> LOKINET_VERSION{{@lokinet_VERSION_MAJOR@, @lokinet_VERSION_MINOR@, @lokinet_VERSION_PATCH@}};
const std::array<uint8_t, 3> 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@";

View File

@ -6,7 +6,7 @@
namespace llarp
{
// Given a full lokinet version of: lokinet-1.2.3-abc these are:
extern const std::array<uint16_t, 3> LOKINET_VERSION;
extern const std::array<uint8_t, 3> LOKINET_VERSION;
extern const char* const LOKINET_VERSION_TAG;
extern const char* const LOKINET_VERSION_FULL;