net/arp: clean the arp table when netdev carrier off

Fix the arp address changed if netdev renew, since the
arp table should be cleared when the netdev carrier off

Signed-off-by: songlinzhang <songlinzhang@xiaomi.com>
This commit is contained in:
songlinzhang
2021-11-27 06:19:50 -06:00
committed by Xiang Xiao
parent 4db9513658
commit 22df553443
7 changed files with 104 additions and 18 deletions
+2
View File
@@ -37,6 +37,7 @@
#include "netdev/netdev.h"
#include "netlink/netlink.h"
#include "arp/arp.h"
/****************************************************************************
* Public Functions
@@ -94,6 +95,7 @@ int netdev_carrier_off(FAR struct net_driver_s *dev)
/* Notify clients that the network has been taken down */
devif_dev_event(dev, NULL, NETDEV_DOWN);
arp_cleanup(dev);
return OK;
}