netlib_setarp.c: add ATF_PERM to mark arp entry as permanent

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.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu 2025-09-08 11:24:08 +08:00 committed by GUIDINGLI
parent 63e2650487
commit c62d0d0875

View file

@ -78,6 +78,7 @@ int netlib_set_arpmapping(FAR const struct sockaddr_in *inaddr,
req.arp_ha.sa_family = ARPHRD_ETHER;
memcpy(&req.arp_ha.sa_data, macaddr, ETHER_ADDR_LEN);
req.arp_flags = ATF_PERM;
if (ifname != NULL)
{
strlcpy((FAR char *)&req.arp_dev, ifname,