3 |
* Address Resolution Protocol module for IP over Ethernet |
* Address Resolution Protocol module for IP over Ethernet |
4 |
* |
* |
5 |
* $Log$ |
* $Log$ |
6 |
|
* Revision 1.23 2003/01/18 16:05:24 jani |
7 |
|
* When all entries are 0 due to the whole table changing since the last arp tick (past 10 seconds) there's no oldest entry and the new entry does not get a spot.Fix this (from Ed Sutter) |
8 |
|
* |
9 |
* Revision 1.22 2003/01/13 09:38:21 jani |
* Revision 1.22 2003/01/13 09:38:21 jani |
10 |
* remove global ctime.Each entry's ctime is now absolute.This avoids wrapping and also solves naming clash reported on the list |
* remove global ctime.Each entry's ctime is now absolute.This avoids wrapping and also solves naming clash reported on the list |
11 |
* |
* |
223 |
} |
} |
224 |
|
|
225 |
/* If no unused entry is found, we try to find the oldest entry and |
/* If no unused entry is found, we try to find the oldest entry and |
226 |
throw it away. */ |
throw it away. If all entries are new and have 0 ctime drop one */ |
227 |
if(i == ARP_TABLE_SIZE) { |
if(i == ARP_TABLE_SIZE) { |
228 |
maxtime = 0; |
maxtime = 0; |
229 |
j = ARP_TABLE_SIZE; |
j = ARP_TABLE_SIZE; |
230 |
for(i = 0; i < ARP_TABLE_SIZE; ++i) { |
for(i = 0; i < ARP_TABLE_SIZE; ++i) { |
231 |
/* remember entry with oldest stable entry in j*/ |
/* remember entry with oldest stable entry in j*/ |
232 |
if((arp_table[i].state == ETHARP_STATE_STABLE) && |
if((arp_table[i].state == ETHARP_STATE_STABLE) && |
233 |
(arp_table[i].ctime > maxtime)) { |
(arp_table[i].ctime >= maxtime)) { |
234 |
maxtime = arp_table[i].ctime; |
maxtime = arp_table[i].ctime; |
235 |
j = i; |
j = i; |
236 |
} |
} |