Skip to content

Commit

Permalink
bier: Fix wrong encapsulation Sub-TLV encoding
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Rybowski <[email protected]>
  • Loading branch information
nrybowski committed Aug 14, 2024
1 parent 4c73ced commit b304b17
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions holo-ospf/src/packet/tlv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,20 +447,21 @@ impl BierSubTlv {
buf.put_u8(self.bar);
buf.put_u8(self.ipa);
buf.put_u16(0);
tlv_encode_end(buf, start_pos);
for subtlv in &self.subtlvs {
match subtlv {
BierSubSubTlv::BierEncapSubSubTlv(encap) => {
let start_pos =
tlv_encode_start(buf, BierSubTlvType::NonMplsEncap);
buf.put_u8(encap.max_si);
buf.put_u24(encap.id.clone().get());
buf.put_u8(encap.bs_len << 4);
buf.put_u8((encap.bs_len << 4) & 0xf0);
buf.put_u24(0);
tlv_encode_end(buf, start_pos);
}
_ => {}
}
}
tlv_encode_end(buf, start_pos);
}
}

Expand Down

0 comments on commit b304b17

Please sign in to comment.