Skip to content

Commit 6daee45

Browse files
committed
Make the flags methods endianness-agnostic
1 parent d718da3 commit 6daee45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rtr/pdu.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ impl RouterKey {
549549
// reserved byte (of zeroes). As the value of the Session field is in
550550
// network byte order, we are actually looking at (Reserved, Flags),
551551
// so we want the lower byte here.
552-
self.fixed.header.session as u8
552+
(u16::from_be(self.fixed.header.session) >> 8) as u8
553553
}
554554

555555
/// Returns the subject key identifier.
@@ -853,7 +853,7 @@ impl Aspa {
853853
// reserved byte (of zeroes). As the value of the Session field is in
854854
// network byte order, we are actually looking at (Reserved, Flags),
855855
// so we want the lower byte here.
856-
self.fixed.header.session as u8
856+
(u16::from_be(self.fixed.header.session) >> 8) as u8
857857
}
858858

859859
/// Returns the customer ASN.

0 commit comments

Comments
 (0)