From b95c3e9ebf41a657fe2cf4bb0eef034411b1f7cd Mon Sep 17 00:00:00 2001 From: Maxime Van Hees Date: Fri, 5 May 2023 18:53:35 +0000 Subject: [PATCH] fixed address encoding bug --- src/codec.rs | 2 ++ src/router.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/codec.rs b/src/codec.rs index fdd5611..9e276bc 100644 --- a/src/codec.rs +++ b/src/codec.rs @@ -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, diff --git a/src/router.rs b/src/router.rs index 9eb3ab3..1f7ce2a 100644 --- a/src/router.rs +++ b/src/router.rs @@ -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