Skip to content

Conversation

@wenquan2015
Copy link

Summary

support ARP entry learned on gratuitous ARP

Impact

arp

Testing

from scapy.all import *

def send_gratuitous_arp(ip, iface=None):

    arp = ARP(
        op=1,
        psrc=ip,
        pdst=ip
    )

    ether = Ether(dst="ff:ff:ff:ff:ff:ff")
    packet = ether/arp

    sendp(packet, iface=iface)

send_gratuitous_arp("10.0.1.4", "nuttx0")

test result, targe ip 10.0.1.4 is not exist, when received gratuitous ARP, the icmp request can be sent out
:

14:44:00.835864 ARP, Request who-has 10.0.1.4 tell 10.0.1.2, length 28
14:44:01.845825 ARP, Request who-has 10.0.1.4 tell 10.0.1.2, length 28
14:44:02.855858 ARP, Request who-has 10.0.1.4 tell 10.0.1.2, length 28
14:44:03.679762 ARP, Request who-has 10.0.1.4 tell 10.0.1.4, length 28
14:44:03.865695 IP 10.0.1.2 > 10.0.1.4: ICMP echo request, id 2, seq 4, length 64
14:44:04.875830 IP 10.0.1.2 > 10.0.1.4: ICMP echo request, id 2, seq 5, length 64
14:44:05.886016 IP 10.0.1.2 > 10.0.1.4: ICMP echo request, id 2, seq 6, length 64

wenquan1 added 2 commits December 26, 2025 14:19
learn arp when receive gratuitous arp response

Signed-off-by: wenquan1 <wenquan1@xiaomi.com>
learn arp when received gratuitiout arp

Signed-off-by: wenquan1 <wenquan1@xiaomi.com>
@github-actions github-actions bot added Area: Networking Effects networking subsystem Size: S The size of the change in this PR is small labels Dec 26, 2025
@anchao anchao merged commit 1f5cd93 into apache:master Dec 30, 2025
105 of 114 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Networking Effects networking subsystem Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants