Skip to content

fix: MAX_DURATION overflows on init

Josh Megnauth requested to merge josh/netstack:fix-33-debug-building into master

Closes: #33 (closed)

Duration is stored as microseconds internally.

The original code caused an overflow by...

Duration::from_millis(u64::MAX);

...which caused u64::MAX to be multiplied by 1000 and overflow.

Also, I compulsively run rustfmt which is why that totally unrelated line changed.

Edited by Josh Megnauth

Merge request reports