icmpv6_neighbor: Simply skip IPv6 conflict detection on L3 Nic

Otherwise, the IP address is always considered to conflict, and the ipv6
address cannot be effectively obtained.
Later we will look at how to perform conflict detection on L3 network cards

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu
2024-02-06 10:27:56 +08:00
committed by Xiang Xiao
parent f739fd010d
commit 0cd893fb5a
+12 -8
View File
@@ -340,17 +340,21 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev)
* method must be employed.
*/
ret = icmpv6_neighbor(dev, lladdr);
if (ret >= 0)
if (dev->d_lltype == NET_LL_ETHERNET ||
dev->d_lltype == NET_LL_IEEE80211)
{
/* Hmmm... someone else responded to our Neighbor Solicitation. We
* have no back-up plan in place. Just bail.
*/
ret = icmpv6_neighbor(dev, lladdr);
if (ret >= 0)
{
/* Hmmm... someone else responded to our Neighbor Solicitation. We
* have no back-up plan in place. Just bail.
*/
nerr("ERROR: IP conflict\n");
nerr("ERROR: IP conflict\n");
net_unlock();
return -EEXIST;
net_unlock();
return -EEXIST;
}
}
#endif