Closed schultetwin1 closed 1 year ago
This is long overdue, thanks!.
@schultetwin1 I think sleepyinstant
is something that belongs as a separate public crate, and would absolutely be useful to more than just us.
@schultetwin1 sleepyinstant will need to go on crates.io for us to get this through. We can't do crates.io releases with path dependencies.
Could you split this off into two PRs, one of which adds sleepyinstant, and the other of which will move us over to sleepyinstant? After the first is merged I can publish sleepyinstant, allowing us to do releases which depend on that crate.
Currently the timers in boringtun use std::time::Instant. This timer does not increment while the machine is asleep on macOS and Linux meaning the device does not know to properly handshake on wake from sleep.
To solve this we use
CLOCK_BOOTTIME
on Linux/Android andCLOCK_MONOTONIC
on macOS/iOS to get the actual duration since the last handshake.Fixes #316