icmpv6: Allow IPv6 address obtained by both
stateless and stateful to coexist. Signed-off-by: liqinhui <liqinhui@xiaomi.com>
This commit is contained in:
parent
c00ff58baa
commit
590c7fe129
|
@ -442,22 +442,18 @@ void icmpv6_input(FAR struct net_driver_s *dev, unsigned int iplen)
|
||||||
FAR struct icmpv6_prefixinfo_s *prefixopt =
|
FAR struct icmpv6_prefixinfo_s *prefixopt =
|
||||||
(FAR struct icmpv6_prefixinfo_s *)opt;
|
(FAR struct icmpv6_prefixinfo_s *)opt;
|
||||||
|
|
||||||
/* if "M" flag isn't set, and the "A" flag is set.
|
/* Is the "A" flag set? */
|
||||||
* Set the new network addresses.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ((adv->flags & ICMPv6_RADV_FLAG_M) == 0 &&
|
if ((prefixopt->flags & ICMPv6_PRFX_FLAG_A) != 0)
|
||||||
(prefixopt->flags & ICMPv6_PRFX_FLAG_A) != 0)
|
|
||||||
{
|
{
|
||||||
icmpv6_setaddresses(dev, ipv6->srcipaddr,
|
/* Yes.. Set the new network addresses. */
|
||||||
|
|
||||||
|
icmpv6_setaddresses(dev, ipv6->srcipaddr,
|
||||||
prefixopt->prefix, prefixopt->preflen);
|
prefixopt->prefix, prefixopt->preflen);
|
||||||
netlink_ipv6_prefix_notify(dev, RTM_NEWPREFIX,
|
netlink_ipv6_prefix_notify(dev, RTM_NEWPREFIX,
|
||||||
prefixopt);
|
prefixopt);
|
||||||
}
|
}
|
||||||
|
else if ((adv->flags & ICMPv6_RADV_FLAG_M) != 0)
|
||||||
/* Set the router address for the stateful process. */
|
|
||||||
|
|
||||||
if ((adv->flags & ICMPv6_RADV_FLAG_M))
|
|
||||||
{
|
{
|
||||||
net_ipv6addr_copy(dev->d_ipv6draddr,
|
net_ipv6addr_copy(dev->d_ipv6draddr,
|
||||||
ipv6->srcipaddr);
|
ipv6->srcipaddr);
|
||||||
|
|
Loading…
Reference in New Issue