net/neighbor: Skip Neighbor request if ip address is invalid at ipv6

Supports no Neighbor request for invalid routing addresses in cross-segment communication

Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
This commit is contained in:
zhangkai25
2025-06-05 10:27:43 +08:00
committed by Xiang Xiao
parent 0625b7a760
commit 7a6b9e9407
2 changed files with 11 additions and 0 deletions
+5
View File
@@ -257,6 +257,11 @@ int icmpv6_neighbor(FAR struct net_driver_s *dev,
net_ipv6addr_copy(lookup, dev->d_ipv6draddr);
#endif
if (net_is_addr_unspecified(lookup))
{
return -EHOSTUNREACH;
}
}
/* No ARP packet if this device do not support ARP */
+6
View File
@@ -135,6 +135,12 @@ void neighbor_ethernet_out(FAR struct net_driver_s *dev)
net_ipv6addr_copy(ipaddr, dev->d_ipv6draddr);
#endif
if (net_is_addr_unspecified(ipaddr))
{
dev->d_len = 0;
return;
}
}
else
{