/[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.34 by jani, Fri Mar 21 10:34:47 2003 UTC revision 1.35 by likewise, Tue Mar 25 12:59:42 2003 UTC
# Line 650  struct pbuf *etharp_query(struct netif * Line 650  struct pbuf *etharp_query(struct netif *
650    for(i = 0; i < ARP_TABLE_SIZE; ++i) {    for(i = 0; i < ARP_TABLE_SIZE; ++i) {
651      if(ip_addr_cmp(ipaddr, &arp_table[i].ipaddr)) {      if(ip_addr_cmp(ipaddr, &arp_table[i].ipaddr)) {
652        if (arp_table[i].state == ETHARP_STATE_PENDING) {        if (arp_table[i].state == ETHARP_STATE_PENDING) {
653          DEBUGF(ETHARP_DEBUG, ("etharp_query: requested IP already pending\n"));          DEBUGF(ETHARP_DEBUG | DBG_TRACE | DBG_STATE, ("etharp_query: requested IP already pending as entry %u\n", i));
654          /* break out of for-loop */          /* break out of for-loop */
655          break;          break;
656        }        }
657        else if (arp_table[i].state == ETHARP_STATE_STABLE) {        else if (arp_table[i].state == ETHARP_STATE_STABLE) {
658          DEBUGF(ETHARP_DEBUG, ("etharp_query: requested IP already stable\n"));          DEBUGF(ETHARP_DEBUG | DBG_TRACE | DBG_STATE, ("etharp_query: requested IP already stable as entry %u\n", i));
659          return NULL;          return NULL;
660        }        }
661      }      }
# Line 663  struct pbuf *etharp_query(struct netif * Line 663  struct pbuf *etharp_query(struct netif *
663    /* queried address not yet pending in ARP table? */    /* queried address not yet pending in ARP table? */
664    if (i == ARP_TABLE_SIZE)    if (i == ARP_TABLE_SIZE)
665    {    {
666      DEBUGF(ETHARP_DEBUG, ("etharp_query: IP address non-pending\n"));      DEBUGF(ETHARP_DEBUG | DBG_TRACE, ("etharp_query: IP address not found in ARP table\n"));
667      /* find an available entry */      /* find an available entry */
668      i = find_arp_entry();      i = find_arp_entry();
669      /* bail out if no ARP entries are available */      /* bail out if no ARP entries are available */
670      if(i == ARP_TABLE_SIZE)      if(i == ARP_TABLE_SIZE)
671      {      {
672        DEBUGF(ETHARP_DEBUG, ("etharp_query: no more ARP table entries available.\n"));        DEBUGF(ETHARP_DEBUG | 2, ("etharp_query: no more ARP entries available.\n"));
673        return NULL;        return NULL;
674      }      }
675      DEBUGF(ETHARP_DEBUG, ("etharp_query: created ARP table entry.\n"));      DEBUGF(ETHARP_DEBUG, ("etharp_query: created ARP table entry %u.\n", i));
676      /* i is available, create ARP entry */      /* i is available, create ARP entry */
677      ip_addr_set(&arp_table[i].ipaddr, ipaddr);      ip_addr_set(&arp_table[i].ipaddr, ipaddr);
678      arp_table[i].ctime = 0;      arp_table[i].ctime = 0;
# Line 690  struct pbuf *etharp_query(struct netif * Line 690  struct pbuf *etharp_query(struct netif *
690      pbuf_ref_chain(q);      pbuf_ref_chain(q);
691      /* remember pbuf to queue, if any */      /* remember pbuf to queue, if any */
692      arp_table[i].p = q;      arp_table[i].p = q;
693      DEBUGF(ETHARP_DEBUG, ("etharp_query: queued packet on ARP entry.\n"));      DEBUGF(ETHARP_DEBUG, ("etharp_query: queued packet %p on ARP entry %u.\n", (void *)q, i));
694    }    }
695  #endif  #endif
696    /* allocate a pbuf for the outgoing ARP request packet */    /* allocate a pbuf for the outgoing ARP request packet */

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

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