diff --git a/src/core/net/dhcp6_client.cpp b/src/core/net/dhcp6_client.cpp index 8e3a678d8..6fe9c83d9 100644 --- a/src/core/net/dhcp6_client.cpp +++ b/src/core/net/dhcp6_client.cpp @@ -559,7 +559,7 @@ exit: otError Client::ProcessIaAddress(Message &aMessage, uint16_t aOffset) { - otError error = OT_ERROR_NONE; + otError error; IaAddress option; SuccessOrExit(error = aMessage.Read(aOffset, option)); @@ -583,10 +583,12 @@ otError Client::ProcessIaAddress(Message &aMessage, uint16_t aOffset) idAssociation.mNetifAddress.mValid = option.GetValidLifetime() != 0; idAssociation.mStatus = kIaStatusSolicitReplied; Get().AddUnicastAddress(idAssociation.mNetifAddress); - break; + ExitNow(error = OT_ERROR_NONE); } } + error = OT_ERROR_NOT_FOUND; + exit: return error; }