/[lwip]/lwip/src/netif/etharp.c
ViewVC logotype

Diff of /lwip/src/netif/etharp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.22 by jani, Mon Jan 13 09:38:21 2003 UTC revision 1.23 by jani, Sat Jan 18 16:05:24 2003 UTC
# Line 3  Line 3 
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   *   *
# Line 220  find_arp_entry(void) Line 223  find_arp_entry(void)
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        }        }

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26