allow versions 2,3,4,5 in v param of address

This commit is contained in:
orignal
2025-12-18 20:20:18 -05:00
parent da8901d40d
commit 04ac2cad17
2 changed files with 8 additions and 4 deletions
+7 -4
View File
@@ -307,13 +307,16 @@ namespace data
}
else if (key == "v")
{
if (value == "2")
if (value.size () == 1 && value[0] >= '2' && value[0] <= '5') // only 2,3,4,5 allowed
{
address->v = value[0] - '0';
isV2 = true;
else
}
else
{
LogPrint (eLogWarning, "RouterInfo: Unexpected value ", value, " for v");
address->transportStyle = eTransportUnknown; // invalid address
}
}
}
else if (key[0] == 'i')
{
@@ -1437,7 +1440,7 @@ namespace data
WriteString ("s", properties); properties << '=';
WriteString (address.s.ToBase64 (), properties); properties << ';';
WriteString ("v", properties); properties << '=';
WriteString ("2", properties); properties << ';';
WriteString (std::to_string(address.v), properties); properties << ';';
}
uint16_t size = htobe16 (properties.str ().size ());
+1
View File
@@ -151,6 +151,7 @@ namespace data
TransportStyle transportStyle;
boost::asio::ip::address host;
Tag<32> s, i; // keys, i is first 16 bytes for NTCP2 and 32 bytes intro key for SSU
int v = 2; // version
int port;
uint64_t date;
uint8_t caps;