From 60a507f88b3812a0696fd70bff74e422cf057b3e Mon Sep 17 00:00:00 2001 From: Elias Reichart Date: Fri, 30 Sep 2016 21:40:10 +0200 Subject: [PATCH] ETHARP_TABLE_MATCH_NETIF is also used in the etharp_output shortcut --- src/core/ipv4/etharp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/ipv4/etharp.c b/src/core/ipv4/etharp.c index 364023e4..2040f390 100644 --- a/src/core/ipv4/etharp.c +++ b/src/core/ipv4/etharp.c @@ -875,6 +875,9 @@ etharp_output(struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr) if (etharp_cached_entry < ARP_TABLE_SIZE) { #endif /* LWIP_NETIF_HWADDRHINT */ 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))) { /* the per-pcb-cached entry is stable and the right one! */ 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 */ for (i = 0; i < ARP_TABLE_SIZE; i++) { 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))) { /* found an existing, stable entry */ ETHARP_SET_HINT(netif, i);