Communication: Fix NetID VNET conflict

There exists a potential conflict with some existing NetIDs and VNET NetIDs in the 200 range. To resolve this there is now an additional optional "expand" argument in various functions that could conflict. In most situations this should be false, and is false for MessageFilters to retain the existing behavior.
This commit is contained in:
Jonathan Schwartz
2023-08-14 21:47:35 +00:00
committed by Kyle Schwarz
parent 41d6927496
commit 53e66b8772
3 changed files with 1234 additions and 1247 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ bool Packetizer::input(const std::vector<uint8_t>& inputBytes) {
packetLength = bytes[2]; // Long packets have a little endian length on bytes 3 and 4
packetLength |= bytes[3] << 8;
packet.network = Network((bytes[5] << 8) | bytes[4]); // Long packets have their netid stored as little endian on bytes 5 and 6
packet.network = Network(((bytes[5] << 8) | bytes[4]), false); // Long packets have their netid stored as little endian on bytes 5 and 6. Devices never send actual VNET IDs so we must not perform ID expansion here.
currentIndex += 4;
/* Long packets can't have a length less than 6, because that would indicate a negative payload size.