@@ -196,6 +196,10 @@ impl InterfaceInner {
}
+ #[cfg(feature = "medium-ethernet")]
+ self.neighbor_cache
+ .reset_expiry_if_existing(IpAddress::Ipv4(ipv4_repr.src_addr), self.now);
+
match ipv4_repr.next_header {
IpProtocol::Icmp => self.process_icmpv4(sockets, ipv4_repr, ip_payload),
@@ -228,6 +228,10 @@ impl InterfaceInner {
#[cfg(not(feature = "socket-raw"))]
let handled_by_raw_socket = false;
+ #[cfg(any(feature = "medium-ethernet", feature = "medium-ieee802154"))]
+ .reset_expiry_if_existing(IpAddress::Ipv6(ipv6_repr.src_addr), self.now);
self.process_nxt_hdr(
sockets,
meta,
@@ -63,6 +63,16 @@ impl Cache {
+ pub fn reset_expiry_if_existing(&mut self, protocol_addr: IpAddress, timestamp: Instant) {
+ if let Some(Neighbor {
+ expires_at,
+ hardware_addr: _,
+ }) = self.storage.get_mut(&protocol_addr)
+ {
+ *expires_at = timestamp + Self::ENTRY_LIFETIME;
+ }
pub fn fill(
&mut self,
protocol_addr: IpAddress,