We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b8da9d commit e65a0e9Copy full SHA for e65a0e9
bgpsim/src/types/prefix.rs
@@ -653,7 +653,8 @@ impl From<i32> for SimplePrefix {
653
impl From<Ipv4Addr> for SimplePrefix {
654
fn from(value: Ipv4Addr) -> Self {
655
let num: u32 = value.into();
656
- SimplePrefix((num - (100 << 24)) >> 8)
+ // WARNING: Do not merge this before talking to Tibor, this is a hack
657
+ SimplePrefix(num.saturating_sub(100u32 << 24) >> 8)
658
}
659
660
0 commit comments