mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
components/lwip/arp: change the arp dropping packet function
LWIP will drop the oldest package at the arp packet cache queue and return "ERR_OK" We change it that ARP level will drop the current packet and return "ERR_MEM" to tell user that you should send the packet again latter.
This commit is contained in:
parent
311a4cd678
commit
cc39b7b286
@ -515,6 +515,7 @@ extern unsigned long os_random(void);
|
|||||||
/* Enable all Espressif-only options */
|
/* Enable all Espressif-only options */
|
||||||
|
|
||||||
#define ESP_LWIP 1
|
#define ESP_LWIP 1
|
||||||
|
#define ESP_LWIP_ARP 1
|
||||||
#define ESP_PER_SOC_TCP_WND 1
|
#define ESP_PER_SOC_TCP_WND 1
|
||||||
#define ESP_THREAD_SAFE 1
|
#define ESP_THREAD_SAFE 1
|
||||||
#define ESP_THREAD_SAFE_DEBUG LWIP_DBG_OFF
|
#define ESP_THREAD_SAFE_DEBUG LWIP_DBG_OFF
|
||||||
|
@ -1192,11 +1192,28 @@ etharp_query(struct netif *netif, const ip4_addr_t *ipaddr, struct pbuf *q)
|
|||||||
}
|
}
|
||||||
#if ARP_QUEUE_LEN
|
#if ARP_QUEUE_LEN
|
||||||
if (qlen >= ARP_QUEUE_LEN) {
|
if (qlen >= ARP_QUEUE_LEN) {
|
||||||
|
#if ESP_LWIP_ARP
|
||||||
|
int l;
|
||||||
|
struct etharp_q_entry *r;
|
||||||
|
|
||||||
|
l = qlen - 1;
|
||||||
|
r = arp_table[i].q;
|
||||||
|
while (l--)
|
||||||
|
r = r->next;
|
||||||
|
r->next = NULL;
|
||||||
|
|
||||||
|
pbuf_free(new_entry->p);
|
||||||
|
memp_free(MEMP_ARP_QUEUE, new_entry);
|
||||||
|
|
||||||
|
LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: could not queue the packet %p (queue is full)\n", (void *)q));
|
||||||
|
return ERR_MEM;
|
||||||
|
#else
|
||||||
struct etharp_q_entry *old;
|
struct etharp_q_entry *old;
|
||||||
old = arp_table[i].q;
|
old = arp_table[i].q;
|
||||||
arp_table[i].q = arp_table[i].q->next;
|
arp_table[i].q = arp_table[i].q->next;
|
||||||
pbuf_free(old->p);
|
pbuf_free(old->p);
|
||||||
memp_free(MEMP_ARP_QUEUE, old);
|
memp_free(MEMP_ARP_QUEUE, old);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: queued packet %p on ARP entry %"S16_F"\n", (void *)q, (s16_t)i));
|
LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: queued packet %p on ARP entry %"S16_F"\n", (void *)q, (s16_t)i));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user