From 033299710fd83763a68ccdb4086d60dfbf1dba73 Mon Sep 17 00:00:00 2001 From: wenquan1 Date: Tue, 5 Aug 2025 14:36:43 +0800 Subject: [PATCH] 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 --- net/arp/arp_notify.c | 1 - net/arp/arp_out.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/net/arp/arp_notify.c b/net/arp/arp_notify.c index fed64880ce6..a4568ed1367 100644 --- a/net/arp/arp_notify.c +++ b/net/arp/arp_notify.c @@ -205,7 +205,6 @@ void arp_notify(in_addr_t ipaddr) curr->nt_result = OK; nxsem_post(&curr->nt_sem); - break; } } diff --git a/net/arp/arp_out.c b/net/arp/arp_out.c index ab7a246a446..a88f37f72ec 100644 --- a/net/arp/arp_out.c +++ b/net/arp/arp_out.c @@ -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;