소스 검색

arp: increment lru when inserting a new entry

Corentin Henry 8 년 전
부모
커밋
eeaf7b6df8
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  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()