[net-diags] set the sock addr based on dest in GetQuery response (#7593)

This commit updates how the `MessageInfo` for a "GetQuery" response
is prepared so that we use link-local source if the destination of
response is also using link-local.
This commit is contained in:
Abtin Keshavarzian
2022-04-15 08:49:01 -07:00
committed by GitHub
parent 73f28712b2
commit 90cd43ac1f
+1 -1
View File
@@ -494,7 +494,7 @@ void NetworkDiagnostic::HandleDiagnosticGetQuery(Coap::Message &aMessage, const
SuccessOrExit(error = message->SetPayloadMarker());
}
if (aMessageInfo.GetSockAddr().IsLinkLocal() || aMessageInfo.GetSockAddr().IsLinkLocalMulticast())
if (aMessageInfo.GetPeerAddr().IsLinkLocal())
{
messageInfo.SetSockAddr(Get<Mle::MleRouter>().GetLinkLocalAddress());
}