EthernetPacket: Allow 1 extra byte at the end of the packet

ValueCAN 4-2EL sends an extra byte to pad the message
to an even byte count.
This commit is contained in:
Paul Hollinsky
2021-05-04 23:25:36 -04:00
parent eca1110305
commit 72bc5914a6
3 changed files with 12 additions and 9 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ uint64_t Decoder::GetUInt64FromLEBytes(const uint8_t* bytes) {
bool Decoder::decode(std::shared_ptr<Message>& result, const std::shared_ptr<Packet>& packet) {
switch(packet->network.getType()) {
case Network::Type::Ethernet:
result = HardwareEthernetPacket::DecodeToMessage(packet->data);
result = HardwareEthernetPacket::DecodeToMessage(packet->data, report);
if(!result) {
report(APIEvent::Type::PacketDecodingError, APIEvent::Severity::Error);
return false; // A nullptr was returned, the packet was not long enough to decode