Outgoing packets caused ARP requests even when the destination IP was already cached.

This commit is contained in:
likewise 2004-07-20 23:07:54 +00:00
parent 58b64d42f1
commit 2074861b57

View File

@ -706,9 +706,6 @@ err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q)
return ERR_ARG;
}
/* send out ARP request */
result = etharp_request(netif, ipaddr);
/* find entry in ARP cache, ask to create entry if queueing packet */
i = find_entry(ipaddr, (q != NULL) ? ETHARP_CREATE : 0);
@ -724,6 +721,12 @@ err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q)
LWIP_ASSERT("arp_table[i].state == PENDING or STABLE",
((arp_table[i].state == ETHARP_STATE_PENDING) ||
(arp_table[i].state == ETHARP_STATE_STABLE)));
/* do we have a pending entry? */
if (arp_table[i].state == ETHARP_STATE_PENDING) {
/* try to resolve it; send out ARP request */
result = etharp_request(netif, ipaddr);
}
/* packet given? */
if (q != NULL) {