You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2026/09/07 11:19:15 UTC
(nuttx) branch releases/13.0 updated (b32a70b11a8 -> 9fbac6686a6)
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a change to branch releases/13.0
in repository https://gitbox.apache.org/repos/asf/nuttx.git
from b32a70b11a8 arch/risc-v/espressif: fix SoftAP-only build of the Wi-Fi event handler
new bddf5ae49ac net/arp: release the device lock before waiting for a resolution
new 9fbac6686a6 net/arp: do not resolve an address to another interface's MAC
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
net/arp/arp_send.c | 5 +++++
net/arp/arp_table.c | 16 ++++++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)
(nuttx) 01/02: net/arp: release the device lock before waiting for a resolution
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch releases/13.0
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit bddf5ae49ac4d8543410b5d21a1390008d1bd088
Author: Felipe Moura <mo...@gmail.com>
AuthorDate: Sun Aug 16 17:28:55 2026 -0300
net/arp: release the device lock before waiting for a resolution
The -EINPROGRESS path jumps over the netdev_unlock() below it, so the
caller waits holding d_lock. The receive path needs that same lock to
dispatch the ARP reply, and the interface stalls for good.
Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Felipe Moura <mo...@gmail.com>
---
net/arp/arp_send.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/arp/arp_send.c b/net/arp/arp_send.c
index 5f97a9807b0..01c5e5bb80b 100644
--- a/net/arp/arp_send.c
+++ b/net/arp/arp_send.c
@@ -328,8 +328,13 @@ int arp_send(in_addr_t ipaddr)
{
/* ARP request for the same destination is in progress, directly
* wait arp response notify.
+ *
+ * Drop the device lock: this path skips the netdev_unlock()
+ * below, and the receive path needs that same lock to deliver
+ * the reply. The waiter above is already installed.
*/
+ netdev_unlock(dev);
goto wait;
}
(nuttx) 02/02: net/arp: do not resolve an address to another interface's MAC
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch releases/13.0
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 9fbac6686a6b6c4570bb223965c1051b31201a5f
Author: Felipe Moura <mo...@gmail.com>
AuthorDate: Sun Aug 16 17:28:55 2026 -0300
net/arp: do not resolve an address to another interface's MAC
On a cache miss arp_find() returns the MAC of any interface holding the
address, ignoring the egress device. Two interfaces on one subnet then
leave the peer unreachable until the entry is relearned.
Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Felipe Moura <mo...@gmail.com>
---
net/arp/arp_table.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/net/arp/arp_table.c b/net/arp/arp_table.c
index a1728989e77..3e2938b7993 100644
--- a/net/arp/arp_table.c
+++ b/net/arp/arp_table.c
@@ -81,8 +81,9 @@
struct arp_table_info_s
{
- in_addr_t ai_ipaddr; /* IP address for lookup */
- FAR uint8_t *ai_ethaddr; /* Location to return the MAC address */
+ in_addr_t ai_ipaddr; /* IP address for lookup */
+ FAR uint8_t *ai_ethaddr; /* Location to return the MAC address */
+ FAR struct net_driver_s *ai_dev; /* The device the frame will be sent on */
};
/****************************************************************************
@@ -117,6 +118,16 @@ static int arp_match(FAR struct net_driver_s *dev, FAR void *arg)
{
FAR struct arp_table_info_s *info = arg;
+ /* Only the egress device may answer for its own address. Otherwise a
+ * frame sent on one interface takes the MAC of another that happens to
+ * hold the address, which breaks setups sharing a subnet.
+ */
+
+ if (info->ai_dev != NULL && dev != info->ai_dev)
+ {
+ return 0;
+ }
+
/* Make sure that this is an Ethernet device (or an IEEE 802.11 device
* which is also Ethernet)
*/
@@ -529,6 +540,7 @@ int arp_find(in_addr_t ipaddr, FAR uint8_t *ethaddr,
info.ai_ipaddr = ipaddr;
info.ai_ethaddr = ethaddr;
+ info.ai_dev = dev;
if (netdev_foreach(arp_match, &info) != 0)
{