icmpv6: Set the default gateway for the stateful dhcpv6.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
This commit is contained in:
liqinhui 2024-01-31 19:11:18 +08:00 committed by Xiang Xiao
parent 0329407d27
commit c00ff58baa
2 changed files with 13 additions and 2 deletions

@ -437,9 +437,12 @@ got_lladdr:
nerr("ERROR: Failed send neighbor advertisement: %d\n", senderr);
}
/* No off-link communications; No router address. */
if (ret != -EADDRNOTAVAIL)
{
/* No off-link communications; No router address. */
net_ipv6addr_copy(dev->d_ipv6draddr, g_ipv6_unspecaddr);
net_ipv6addr_copy(dev->d_ipv6draddr, g_ipv6_unspecaddr);
}
}
/* 5. Router Direction: The router provides direction to the node on how

@ -455,6 +455,14 @@ void icmpv6_input(FAR struct net_driver_s *dev, unsigned int iplen)
prefixopt);
}
/* Set the router address for the stateful process. */
if ((adv->flags & ICMPv6_RADV_FLAG_M))
{
net_ipv6addr_copy(dev->d_ipv6draddr,
ipv6->srcipaddr);
}
/* Notify any waiting threads */
icmpv6_rnotify(dev, (adv->flags & ICMPv6_RADV_FLAG_M) ?