diff --git a/net/icmpv6/icmpv6_autoconfig.c b/net/icmpv6/icmpv6_autoconfig.c index 804fc6d574..d51492b939 100644 --- a/net/icmpv6/icmpv6_autoconfig.c +++ b/net/icmpv6/icmpv6_autoconfig.c @@ -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 diff --git a/net/icmpv6/icmpv6_input.c b/net/icmpv6/icmpv6_input.c index e922422de5..69b9621f41 100644 --- a/net/icmpv6/icmpv6_input.c +++ b/net/icmpv6/icmpv6_input.c @@ -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) ?