net/arp: fix the problem of arp notify and flood arp sending

when a arp response reached, it should notify all tasks waiting the address. if the address is unreachable, do not send arp request to prevent arp flooding.

Signed-off-by: wenquan1 <wenquan1@xiaomi.com>
This commit is contained in:
wenquan1
2025-08-05 14:36:43 +08:00
committed by Xiang Xiao
parent ea31ceac23
commit 033299710f
2 changed files with 1 additions and 2 deletions
-1
View File
@@ -205,7 +205,6 @@ void arp_notify(in_addr_t ipaddr)
curr->nt_result = OK;
nxsem_post(&curr->nt_sem);
break;
}
}
+1 -1
View File
@@ -253,7 +253,7 @@ void arp_out(FAR struct net_driver_s *dev)
{
/* No send ARP if the interface forbidden */
if (IFF_IS_NOARP(dev->d_flags))
if (IFF_IS_NOARP(dev->d_flags) || ret == -ENETUNREACH)
{
ninfo("ARP not supported on %s, no send!\n", dev->d_ifname);
dev->d_len = 0;