Skip to content

Conversation

@zhhyu7
Copy link
Contributor

@zhhyu7 zhhyu7 commented Dec 30, 2025

Summary

  1. Improve the behavior of the ARP table so that the manually configured
    ARP table has the highest priority, can only be manually modified to
    other values, otherwise will never change again, and will not time out.
    The modified behavior is consistent with that of Linux.

Impact

net:arp

Testing

sim:matter with ping
NuttX log:

NuttShell (NSH) NuttX-12.12.0-RC0
MOTD: username=admin password=Administrator
nsh> ping -c 3 10.0.1.1
PING 10.0.1.1 56 bytes of data
56 bytes from 10.0.1.1: icmp_seq=0 time=0.0 ms
56 bytes from 10.0.1.1: icmp_seq=1 time=0.0 ms
56 bytes from 10.0.1.1: icmp_seq=2 time=0.0 ms
3 packets transmitted, 3 received, 0% packet loss, time 3030 ms
rtt min/avg/max/mdev = 0.000/0.000/0.000/0.000 ms
nsh> ping -c 3 10.0.1.3
PING 10.0.1.3 56 bytes of data
56 bytes from 10.0.1.3: icmp_seq=0 time=20.0 ms
56 bytes from 10.0.1.3: icmp_seq=1 time=10.0 ms
56 bytes from 10.0.1.3: icmp_seq=2 time=10.0 ms
3 packets transmitted, 3 received, 0% packet loss, time 3030 ms
rtt min/avg/max/mdev = 10.000/13.333/20.000/4.714 ms
nsh> ping -c 3 10.0.1.4
PING 10.0.1.4 56 bytes of data
ERROR: sendto failed at seqno 0: 101
ERROR: sendto failed at seqno 1: 101
ERROR: sendto failed at seqno 2: 101
3 packets transmitted, 0 received, 100% packet loss, time 3030 ms
nsh> ping -c 3 10.0.1.3
PING 10.0.1.3 56 bytes of data
56 bytes from 10.0.1.3: icmp_seq=0 time=10.0 ms
56 bytes from 10.0.1.3: icmp_seq=1 time=10.0 ms
56 bytes from 10.0.1.3: icmp_seq=2 time=10.0 ms
3 packets transmitted, 3 received, 0% packet loss, time 3030 ms
rtt min/avg/max/mdev = 10.000/10.000/10.000/0.000 ms
nsh> poweroff
[Inferior 1 (process 2446441) exited normally]
(gdb) q
nuttx$ cat .config | grep ARP
# ARP Configuration
CONFIG_NET_ARP=y
CONFIG_NET_ARPTAB_SIZE=16
CONFIG_NET_ARP_MAXAGE=120
CONFIG_NET_ARP_MAXAGE_UNREACHABLE=1
# CONFIG_NET_ARP_IPIN is not set
# CONFIG_NET_ARP_GRATUITOUS is not set
CONFIG_NET_ARP_SEND=y
CONFIG_NET_ARP_SEND_QUEUE=y
CONFIG_ARP_SEND_MAXTRIES=5
CONFIG_ARP_SEND_DELAYMSEC=20
# CONFIG_NET_ARP_ACD is not set
# end of ARP Configuration
# CONFIG_NSH_DISABLE_ARP is not set

@github-actions github-actions bot added Area: Networking Effects networking subsystem Area: Memory Management Memory Management issues Size: M The size of the change in this PR is medium labels Dec 30, 2025
@xiaoxiang781216 xiaoxiang781216 changed the title change to macro or guard with CONFIG_USERSOCK in usersock.h ARP table improvement Dec 30, 2025
wenquan1 and others added 3 commits December 31, 2025 21:26
add interface support to merge iob queues, providing support for
subsequent features.

Signed-off-by: wenquan1 <[email protected]>
Improve the behavior of the ARP table so that the manually configured
ARP table has the highest priority, can only be manually modified to
other values, otherwise will never change again, and will not time out.
The modified behavior is consistent with that of Linux.

Signed-off-by: zhanghongyu <[email protected]>
arp_out will replace the dev->d_iob to arp request if the iob destination
address is not exist in arp table, this mechanism cause this iob lost
result in first received ping no response or first synack retransmit.
to fix this bug, we queue the iob if arp_out failed, allocate a new
iob to send arp request, after the arp request completed, then we retry
send the queue iob packet.

Signed-off-by: wenquan1 <[email protected]>
This reverts commit 696a94c8055dc59933457e8ce5c3c91dbecab980
first, when continuous ping from tester to vela, if ignore arp expire when ping response use arp_out to build L2 layer, this cause TC13 testing arp entry expire feature failed. second, the patch of support queue iob when arp_out failed can fix this bug.

Signed-off-by: wenquan1 <[email protected]>
@xiaoxiang781216 xiaoxiang781216 merged commit d6bd89f into apache:master Jan 1, 2026
40 checks passed
@jerpelea
Copy link
Contributor

jerpelea commented Jan 2, 2026

please use proper PR title

ex:
net/arp: arp table improvement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Memory Management Memory Management issues Area: Networking Effects networking subsystem Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants