Created
June 13, 2021 21:07
-
-
Save saethlin/3972fc7222e8552890f5003e4b90c382 to your computer and use it in GitHub Desktop.
Does the PACKET_MMAP clock go backwards?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let mut cap = packet_capture::Capture::new("enp68s0").unwrap(); | |
| let mut previous_time = (0, 0); | |
| loop { | |
| let packet = cap.next(); | |
| let time = (packet.tp_sec, packet.tp_nsec); | |
| if time < previous_time { | |
| println!("{:?}: {:?} {:?}", chrono::Local::now(), time, previous_time); | |
| } else { | |
| previous_time = time; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment