Browse Source

arp: increment lru when inserting a new entry

Corentin Henry 8 years ago
parent
commit
eeaf7b6df8
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/iface/arp_cache.rs

+ 1 - 0
src/iface/arp_cache.rs

@@ -97,6 +97,7 @@ impl<'a> Cache for SliceCache<'a> {
     fn fill(&mut self, protocol_addr: &IpAddress, hardware_addr: &EthernetAddress) {
         if let None = self.find(protocol_addr) {
             let lru_index = self.lru();
+            self.counter += 1;
             self.storage[lru_index] =
                 (*protocol_addr, *hardware_addr, self.counter);
             self.sort()