fixed address encoding bug

This commit is contained in:
Maxime Van Hees
2023-05-05 18:53:35 +00:00
parent 7cdf8fe4b2
commit b95c3e9ebf
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -282,11 +282,13 @@ impl Decoder for ControlPacketCodec {
)),
_ => return Err(io::Error::new(io::ErrorKind::InvalidData, "Invalid address encoding")),
};
println!("UPDATE decoded successfully!");
Some(BabelPacketBody {
tlv_type,
length,
body: BabelTLV::Update { address_encoding, prefix_length, interval, seqno, metric, prefix }
})
}
// Add decoding logic for other TLV types.
_ => None,
+1 -1
View File
@@ -247,7 +247,7 @@ impl Router {
tlv_type: BabelTLVType::Update,
length: 14,
body: BabelTLV::Update {
address_encoding: 1, // AE of 1 indicated IPv4
address_encoding: 0, // AE of 1 indicated IPv4
prefix_length: 32, // temp value - working with full IPv4 for now, not prefix-based
interval: 999, // temp value
seqno: 0, // temp value