We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cec04d9 + ece00ac commit 48cb672Copy full SHA for 48cb672
src/iface/neighbor.rs
@@ -72,8 +72,21 @@ impl Cache {
72
debug_assert!(protocol_addr.is_unicast());
73
debug_assert!(hardware_addr.is_unicast());
74
75
+ let expires_at = timestamp + Self::ENTRY_LIFETIME;
76
+ self.fill_with_expiration(protocol_addr, hardware_addr, expires_at);
77
+ }
78
+
79
+ pub fn fill_with_expiration(
80
+ &mut self,
81
+ protocol_addr: IpAddress,
82
+ hardware_addr: HardwareAddress,
83
+ expires_at: Instant,
84
+ ) {
85
+ debug_assert!(protocol_addr.is_unicast());
86
+ debug_assert!(hardware_addr.is_unicast());
87
88
let neighbor = Neighbor {
- expires_at: timestamp + Self::ENTRY_LIFETIME,
89
+ expires_at,
90
hardware_addr,
91
};
92
match self.storage.insert(protocol_addr, neighbor) {
0 commit comments