mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-26 01:57:01 +08:00
fixed bug #34684: Clear the arp table cache when netif is brought down
This commit is contained in:
@@ -112,9 +112,7 @@ struct etharp_entry {
|
||||
struct pbuf *q;
|
||||
#endif /* ARP_QUEUEING */
|
||||
ip_addr_t ipaddr;
|
||||
#if LWIP_SNMP
|
||||
struct netif *netif;
|
||||
#endif /* LWIP_SNMP */
|
||||
struct eth_addr ethaddr;
|
||||
u8_t state;
|
||||
u8_t ctime;
|
||||
@@ -578,6 +576,23 @@ etharp_remove_static_entry(ip_addr_t *ipaddr)
|
||||
}
|
||||
#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */
|
||||
|
||||
/**
|
||||
* Remove all ARP table entries of the specified netif.
|
||||
*
|
||||
* @param netif points to a network interface
|
||||
*/
|
||||
void etharp_cleanup_netif(struct netif *netif)
|
||||
{
|
||||
u8_t i;
|
||||
|
||||
for (i = 0; i < ARP_TABLE_SIZE; ++i) {
|
||||
u8_t state = arp_table[i].state;
|
||||
if ((state != ETHARP_STATE_EMPTY) && (arp_table[i].netif == netif)) {
|
||||
etharp_free_entry(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds (stable) ethernet/IP address pair from ARP table
|
||||
* using interface and IP address index.
|
||||
|
||||
Reference in New Issue
Block a user