202 |
/* remember entry with oldest stable entry in j*/ |
/* remember entry with oldest stable entry in j*/ |
203 |
if((arp_table[i].state == ETHARP_STATE_STABLE) && |
if((arp_table[i].state == ETHARP_STATE_STABLE) && |
204 |
#if ARP_QUEUEING /* do not want to re-use an entry with queued packets */ |
#if ARP_QUEUEING /* do not want to re-use an entry with queued packets */ |
205 |
(arp_table[i].p != NULL) && |
(arp_table[i].p == NULL) && |
206 |
#endif |
#endif |
207 |
(arp_table[i].ctime >= maxtime)) { |
(arp_table[i].ctime >= maxtime)) { |
208 |
maxtime = arp_table[i].ctime; |
maxtime = arp_table[i].ctime; |
682 |
arp_table[i].p = NULL; |
arp_table[i].p = NULL; |
683 |
#endif |
#endif |
684 |
} |
} |
685 |
|
#if ARP_QUEUEING |
686 |
|
/* any pbuf to queue and queue is empty? */ |
687 |
|
if ((q != NULL) && (arp_table[i].p == NULL)) { |
688 |
|
/* copy PBUF_REF referenced payloads to PBUF_RAM */ |
689 |
|
q = pbuf_unref(q); |
690 |
|
/* pbufs are queued, increase the reference count */ |
691 |
|
pbuf_ref_chain(q); |
692 |
|
/* remember pbuf to queue, if any */ |
693 |
|
arp_table[i].p = q; |
694 |
|
DEBUGF(ETHARP_DEBUG, ("etharp_query: queued packet on ARP entry.\n")); |
695 |
|
} |
696 |
|
#endif |
697 |
/* allocate a pbuf for the outgoing ARP request packet */ |
/* allocate a pbuf for the outgoing ARP request packet */ |
698 |
p = pbuf_alloc(PBUF_LINK, sizeof(struct etharp_hdr), PBUF_RAM); |
p = pbuf_alloc(PBUF_LINK, sizeof(struct etharp_hdr), PBUF_RAM); |
699 |
/* could allocate pbuf? */ |
/* could allocate pbuf? */ |
729 |
} else { |
} else { |
730 |
DEBUGF(ETHARP_DEBUG, ("etharp_query: could not allocate pbuf for ARP request.\n")); |
DEBUGF(ETHARP_DEBUG, ("etharp_query: could not allocate pbuf for ARP request.\n")); |
731 |
} |
} |
|
#if ARP_QUEUEING |
|
|
/* any pbuf to queue and queue is empty? */ |
|
|
if ((q != NULL) && (arp_table[i].p == NULL)) { |
|
|
/* copy PBUF_REF referenced payloads to PBUF_RAM */ |
|
|
q = pbuf_unref(q); |
|
|
/* pbufs are queued, increase the reference count */ |
|
|
pbuf_ref_chain(q); |
|
|
/* remember pbuf to queue, if any */ |
|
|
arp_table[i].p = q; |
|
|
DEBUGF(ETHARP_DEBUG, ("etharp_query: queued packet on ARP entry.\n")); |
|
|
} |
|
|
#endif |
|
732 |
return NULL; |
return NULL; |
733 |
} |
} |