File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ use std::collections::BTreeMap;
8
8
use std:: net:: Ipv4Addr ;
9
9
use std:: sync:: atomic:: AtomicU32 ;
10
10
use std:: sync:: Arc ;
11
- use std:: time:: Duration ;
11
+ use std:: time:: { Duration , SystemTime , UNIX_EPOCH } ;
12
12
13
13
use async_trait:: async_trait;
14
14
use chrono:: { DateTime , Utc } ;
@@ -482,7 +482,17 @@ where
482
482
neighbors : Default :: default ( ) ,
483
483
routes : Default :: default ( ) ,
484
484
statistics : Default :: default ( ) ,
485
- auth_seqno : Default :: default ( ) ,
485
+ // Initialize the authentication sequence number as the number of
486
+ // seconds since the Unix epoch (1 January 1970).
487
+ // By using this approach, the chances of successfully replaying
488
+ // packets from a restarted RIP instance are significantly reduced.
489
+ auth_seqno : Arc :: new (
490
+ ( SystemTime :: now ( )
491
+ . duration_since ( UNIX_EPOCH )
492
+ . expect ( "Time went backwards" )
493
+ . as_secs ( ) as u32 )
494
+ . into ( ) ,
495
+ ) ,
486
496
}
487
497
}
488
498
You can’t perform that action at this time.
0 commit comments