mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 14:58:13 +08:00
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:
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user