mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
lwip: add code for sending gratuitous ARP periodically
This commit is contained in:
parent
9cce5f5a55
commit
237cc88b9f
@ -128,6 +128,23 @@ config LWIP_ETHARP_TRUST_IP_MAC
|
|||||||
So the recommendation is to disable this option.
|
So the recommendation is to disable this option.
|
||||||
Here the LAN peer means the other side to which the ESP station or soft-AP is connected.
|
Here the LAN peer means the other side to which the ESP station or soft-AP is connected.
|
||||||
|
|
||||||
|
config ESP_GRATUITOUS_ARP
|
||||||
|
bool "Send gratuitous ARP periodically"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Enable this option allows to send gratuitous ARP periodically.
|
||||||
|
|
||||||
|
This option solve the compatibility issues.If the ARP table of the AP is old, and the AP
|
||||||
|
doesn't send ARP request to update it's ARP table, this will lead to the STA sending IP packet fail.
|
||||||
|
Thus we send gratuitous ARP periodically to let AP update it's ARP table.
|
||||||
|
|
||||||
|
config GARP_TMR_INTERVAL
|
||||||
|
int "GARP timer interval(seconds)"
|
||||||
|
default 60
|
||||||
|
depends on ESP_GRATUITOUS_ARP
|
||||||
|
help
|
||||||
|
Set the timer interval for gratuitous ARP. The default value is 60s
|
||||||
|
|
||||||
config TCPIP_RECVMBOX_SIZE
|
config TCPIP_RECVMBOX_SIZE
|
||||||
int "TCPIP task receive mail box size"
|
int "TCPIP task receive mail box size"
|
||||||
default 32
|
default 32
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 18548d1e256f7651fb4da48dbd770556e0eca8ce
|
Subproject commit e6bb43349ed859eba4c1e3cae15b932627c45c4b
|
@ -739,6 +739,7 @@
|
|||||||
#define ESP_PING 1
|
#define ESP_PING 1
|
||||||
#define ESP_HAS_SELECT 1
|
#define ESP_HAS_SELECT 1
|
||||||
#define ESP_AUTO_RECV 1
|
#define ESP_AUTO_RECV 1
|
||||||
|
#define ESP_GRATUITOUS_ARP CONFIG_ESP_GRATUITOUS_ARP
|
||||||
|
|
||||||
#if CONFIG_LWIP_IRAM_OPTIMIZATION
|
#if CONFIG_LWIP_IRAM_OPTIMIZATION
|
||||||
#define ESP_IRAM_ATTR IRAM_ATTR
|
#define ESP_IRAM_ATTR IRAM_ATTR
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "lwip/ip6_addr.h"
|
#include "lwip/ip6_addr.h"
|
||||||
#include "lwip/nd6.h"
|
#include "lwip/nd6.h"
|
||||||
#include "lwip/priv/tcpip_priv.h"
|
#include "lwip/priv/tcpip_priv.h"
|
||||||
|
#include "lwip/netif.h"
|
||||||
#if LWIP_DNS /* don't build if not configured for use in lwipopts.h */
|
#if LWIP_DNS /* don't build if not configured for use in lwipopts.h */
|
||||||
#include "lwip/dns.h"
|
#include "lwip/dns.h"
|
||||||
#endif
|
#endif
|
||||||
@ -184,6 +185,12 @@ static esp_err_t tcpip_adapter_start(tcpip_adapter_if_t tcpip_if, uint8_t *mac,
|
|||||||
netif_init = tcpip_if_to_netif_init_fn(tcpip_if);
|
netif_init = tcpip_if_to_netif_init_fn(tcpip_if);
|
||||||
assert(netif_init != NULL);
|
assert(netif_init != NULL);
|
||||||
netif_add(esp_netif[tcpip_if], &ip_info->ip, &ip_info->netmask, &ip_info->gw, NULL, netif_init, tcpip_input);
|
netif_add(esp_netif[tcpip_if], &ip_info->ip, &ip_info->netmask, &ip_info->gw, NULL, netif_init, tcpip_input);
|
||||||
|
#if ESP_GRATUITOUS_ARP
|
||||||
|
if (tcpip_if == TCPIP_ADAPTER_IF_STA || tcpip_if == TCPIP_ADAPTER_IF_ETH) {
|
||||||
|
netif_set_garp_flag(esp_netif[tcpip_if]);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tcpip_if == TCPIP_ADAPTER_IF_AP) {
|
if (tcpip_if == TCPIP_ADAPTER_IF_AP) {
|
||||||
|
Loading…
Reference in New Issue
Block a user