net/icmpv6/icmpv6_autoconfig.c: cmpv6_autoconfig() error handling must not overwrite overwrite the error code.

This commit is contained in:
Xiang Xiao 2019-09-20 12:51:37 -06:00 committed by Gregory Nutt
parent 6c484847d5
commit b4e7ca5aac

View file

@ -425,6 +425,8 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev)
if (ret < 0)
{
int senderr;
nerr("ERROR: Failed to get the router advertisement: %d (retries=%d)\n",
ret, retries);
@ -432,10 +434,10 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev)
* Advertisement message.
*/
ret = icmpv6_send_message(dev, true);
if (ret < 0)
senderr = icmpv6_send_message(dev, true);
if (senderr < 0)
{
nerr("ERROR: Failed send neighbor advertisement: %d\n", ret);
nerr("ERROR: Failed send neighbor advertisement: %d\n", senderr);
}
/* No off-link communications; No router address. */