Skip to content

Commit e9213b3

Browse files
committed
Update comments in flags methods
1 parent 6daee45 commit e9213b3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/rtr/pdu.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,8 @@ impl RouterKey {
547547
pub fn flags(&self) -> u8 {
548548
// The two-byte Session field is reused for the Flags byte and one
549549
// reserved byte (of zeroes). As the value of the Session field is in
550-
// network byte order, we are actually looking at (Reserved, Flags),
551-
// so we want the lower byte here.
550+
// network byte order, we first convert it, then shift out the lower
551+
// byte.
552552
(u16::from_be(self.fixed.header.session) >> 8) as u8
553553
}
554554

@@ -851,8 +851,8 @@ impl Aspa {
851851
pub fn flags(&self) -> u8 {
852852
// The two-byte Session field is reused for the Flags byte and one
853853
// reserved byte (of zeroes). As the value of the Session field is in
854-
// network byte order, we are actually looking at (Reserved, Flags),
855-
// so we want the lower byte here.
854+
// network byte order, we first convert it, then shift out the lower
855+
// byte.
856856
(u16::from_be(self.fixed.header.session) >> 8) as u8
857857
}
858858

0 commit comments

Comments
 (0)