mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 21:44:38 +08:00
ETHARP_TABLE_MATCH_NETIF is also used in the etharp_output shortcut
This commit is contained in:
parent
0d7805a86a
commit
60a507f88b
@ -875,6 +875,9 @@ etharp_output(struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr)
|
|||||||
if (etharp_cached_entry < ARP_TABLE_SIZE) {
|
if (etharp_cached_entry < ARP_TABLE_SIZE) {
|
||||||
#endif /* LWIP_NETIF_HWADDRHINT */
|
#endif /* LWIP_NETIF_HWADDRHINT */
|
||||||
if ((arp_table[etharp_cached_entry].state >= ETHARP_STATE_STABLE) &&
|
if ((arp_table[etharp_cached_entry].state >= ETHARP_STATE_STABLE) &&
|
||||||
|
#if ETHARP_TABLE_MATCH_NETIF
|
||||||
|
(arp_table[etharp_cached_entry].netif == netif) &&
|
||||||
|
#endif
|
||||||
(ip4_addr_cmp(dst_addr, &arp_table[etharp_cached_entry].ipaddr))) {
|
(ip4_addr_cmp(dst_addr, &arp_table[etharp_cached_entry].ipaddr))) {
|
||||||
/* the per-pcb-cached entry is stable and the right one! */
|
/* the per-pcb-cached entry is stable and the right one! */
|
||||||
ETHARP_STATS_INC(etharp.cachehit);
|
ETHARP_STATS_INC(etharp.cachehit);
|
||||||
@ -889,6 +892,9 @@ etharp_output(struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr)
|
|||||||
throughput and etharp_find_entry() is kind of slow */
|
throughput and etharp_find_entry() is kind of slow */
|
||||||
for (i = 0; i < ARP_TABLE_SIZE; i++) {
|
for (i = 0; i < ARP_TABLE_SIZE; i++) {
|
||||||
if ((arp_table[i].state >= ETHARP_STATE_STABLE) &&
|
if ((arp_table[i].state >= ETHARP_STATE_STABLE) &&
|
||||||
|
#if ETHARP_TABLE_MATCH_NETIF
|
||||||
|
(arp_table[i].netif == netif) &&
|
||||||
|
#endif
|
||||||
(ip4_addr_cmp(dst_addr, &arp_table[i].ipaddr))) {
|
(ip4_addr_cmp(dst_addr, &arp_table[i].ipaddr))) {
|
||||||
/* found an existing, stable entry */
|
/* found an existing, stable entry */
|
||||||
ETHARP_SET_HINT(netif, i);
|
ETHARP_SET_HINT(netif, i);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user