From 753089865baae952015743872ae700ad8932c6f3 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Sat, 7 Nov 2020 19:45:04 -0800 Subject: [PATCH] [dhcp6-client] return error if Identity Association is not found (#5782) --- src/core/net/dhcp6_client.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; }