From 0315ac0a0fee0d239634e32ef8e85f2731adc596 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Fri, 8 May 2020 18:20:24 -0700 Subject: [PATCH] [dhcp6-client] change Solicit() to return void (#4941) --- src/core/net/dhcp6_client.cpp | 15 +++++++++------ src/core/net/dhcp6_client.hpp | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/core/net/dhcp6_client.cpp b/src/core/net/dhcp6_client.cpp index 8d1666789..bc9bb30ca 100644 --- a/src/core/net/dhcp6_client.cpp +++ b/src/core/net/dhcp6_client.cpp @@ -238,7 +238,7 @@ bool Dhcp6Client::HandleTrickleTimer(void) // fall through case kIaStatusSoliciting: - IgnoreError(Solicit(mIdentityAssociationCurrent->mPrefixAgentRloc)); + Solicit(mIdentityAssociationCurrent->mPrefixAgentRloc); break; case kIaStatusSolicitReplied: @@ -261,7 +261,7 @@ exit: return rval; } -otError Dhcp6Client::Solicit(uint16_t aRloc16) +void Dhcp6Client::Solicit(uint16_t aRloc16) { otError error = OT_ERROR_NONE; Message * message; @@ -290,12 +290,15 @@ otError Dhcp6Client::Solicit(uint16_t aRloc16) exit: - if (message != NULL && error != OT_ERROR_NONE) + if (message != NULL) { - message->Free(); - } + otLogWarnIp6("Failed to send DHCPv6 Solicit: %s", otThreadErrorToString(error)); - return error; + if (error != OT_ERROR_NONE) + { + message->Free(); + } + } } otError Dhcp6Client::AppendHeader(Message &aMessage) diff --git a/src/core/net/dhcp6_client.hpp b/src/core/net/dhcp6_client.hpp index e38ca0dbd..5b68fb085 100644 --- a/src/core/net/dhcp6_client.hpp +++ b/src/core/net/dhcp6_client.hpp @@ -123,7 +123,7 @@ private: static bool MatchNetifAddressWithPrefix(const Ip6::NetifUnicastAddress &aAddress, const otIp6Prefix &aIp6Prefix); - otError Solicit(uint16_t aRloc16); + void Solicit(uint16_t aRloc16); void AddIdentityAssociation(uint16_t aRloc16, otIp6Prefix &aIp6Prefix); void RemoveIdentityAssociation(uint16_t aRloc16, otIp6Prefix &aIp6Prefix);