mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-22 16:20:54 +00:00
fixed bug #34684: Clear the arp table cache when netif is brought down
This commit is contained in:
parent
b361533584
commit
f0b0a3760c
@ -49,6 +49,10 @@ HISTORY
|
|||||||
|
|
||||||
++ Bugfixes:
|
++ Bugfixes:
|
||||||
|
|
||||||
|
2011-11-22: Simon Goldschmidt
|
||||||
|
* netif.c, etharp.h/.c: fixed bug #34684: Clear the arp table cache when
|
||||||
|
netif is brought down
|
||||||
|
|
||||||
2011-10-28: Simon Goldschmidt
|
2011-10-28: Simon Goldschmidt
|
||||||
* tcp_in.c: fixed bug #34638: Dead code in tcp_receive - pcb->dupacks
|
* tcp_in.c: fixed bug #34638: Dead code in tcp_receive - pcb->dupacks
|
||||||
|
|
||||||
|
@ -497,6 +497,11 @@ void netif_set_down(struct netif *netif)
|
|||||||
snmp_get_sysuptime(&netif->ts);
|
snmp_get_sysuptime(&netif->ts);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if LWIP_ARP
|
||||||
|
if (netif->flags & NETIF_FLAG_ETHARP) {
|
||||||
|
etharp_cleanup_netif(netif);
|
||||||
|
}
|
||||||
|
#endif /* LWIP_ARP */
|
||||||
NETIF_STATUS_CALLBACK(netif);
|
NETIF_STATUS_CALLBACK(netif);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -190,6 +190,7 @@ err_t etharp_request(struct netif *netif, ip_addr_t *ipaddr);
|
|||||||
* nodes to update an entry in their ARP cache.
|
* nodes to update an entry in their ARP cache.
|
||||||
* From RFC 3220 "IP Mobility Support for IPv4" section 4.6. */
|
* From RFC 3220 "IP Mobility Support for IPv4" section 4.6. */
|
||||||
#define etharp_gratuitous(netif) etharp_request((netif), &(netif)->ip_addr)
|
#define etharp_gratuitous(netif) etharp_request((netif), &(netif)->ip_addr)
|
||||||
|
void etharp_cleanup_netif(struct netif *netif);
|
||||||
|
|
||||||
#if ETHARP_SUPPORT_STATIC_ENTRIES
|
#if ETHARP_SUPPORT_STATIC_ENTRIES
|
||||||
err_t etharp_add_static_entry(ip_addr_t *ipaddr, struct eth_addr *ethaddr);
|
err_t etharp_add_static_entry(ip_addr_t *ipaddr, struct eth_addr *ethaddr);
|
||||||
|
@ -106,9 +106,7 @@ struct etharp_entry {
|
|||||||
struct pbuf *q;
|
struct pbuf *q;
|
||||||
#endif /* ARP_QUEUEING */
|
#endif /* ARP_QUEUEING */
|
||||||
ip_addr_t ipaddr;
|
ip_addr_t ipaddr;
|
||||||
#if LWIP_SNMP
|
|
||||||
struct netif *netif;
|
struct netif *netif;
|
||||||
#endif /* LWIP_SNMP */
|
|
||||||
struct eth_addr ethaddr;
|
struct eth_addr ethaddr;
|
||||||
u8_t state;
|
u8_t state;
|
||||||
u8_t ctime;
|
u8_t ctime;
|
||||||
@ -574,6 +572,23 @@ etharp_remove_static_entry(ip_addr_t *ipaddr)
|
|||||||
}
|
}
|
||||||
#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */
|
#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
|
* Finds (stable) ethernet/IP address pair from ARP table
|
||||||
* using interface and IP address index.
|
* using interface and IP address index.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user