mirror of
https://github.com/threefoldtech/mycelium.git
synced 2026-06-06 15:51:40 +00:00
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:
+2
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user