Fix skipping of unknown TLV's

Since we already read a TLV type and TLV len byte, we need to decrement
the header length by 2 instead of 1

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet
2024-01-17 15:07:29 +01:00
parent 191da7ed18
commit b70fa579ed
+2 -1
View File
@@ -145,7 +145,8 @@ impl Decoder for Codec {
_ => {
// unrecoginized body type, silently drop
trace!("Dropping unrecognized tlv");
src.advance(header.body_length as usize - 1);
// We already read 2 bytes
src.advance(header.body_length as usize - 2);
self.reset();
return Ok(None);
}