mirror of
https://github.com/espressif/openthread.git
synced 2026-09-10 03:00:09 +00:00
[tmf] remove redundant SetSockPortToTmf() calls (#12544)
This commit removes calls to `SetSockPortToTmf()` from the Border Agent prior to sending messages via `Tmf::Agent`. Setting the local socket port is unnecessary because the `Tmf::Agent` is already bound to the TMF port number when sending CoAP messages. Additionally, since these removals eliminate the last uses of the `SetSockPortToTmf()` method within the codebase, the method itself has been completely removed from `Tmf::MessageInfo` class to clean up dead code.
This commit is contained in:
@@ -520,7 +520,6 @@ Error Manager::EvictActiveCommissioner(void)
|
||||
SuccessOrExit(error = Tlv::Append<CommissionerSessionIdTlv>(*message, sessionId));
|
||||
|
||||
messageInfo.SetSockAddrToRlocPeerAddrToLeaderAloc();
|
||||
messageInfo.SetSockPortToTmf();
|
||||
|
||||
error = Get<Tmf::Agent>().SendMessage(message.PassOwnership(), messageInfo);
|
||||
|
||||
@@ -722,7 +721,6 @@ Error Manager::CoapDtlsSession::ForwardToLeader(const Coap::Msg &aMsg, Uri aUri)
|
||||
SuccessOrExit(error = message->AppendBytesFromMessage(aMsg.mMessage, offsetRange));
|
||||
|
||||
messageInfo.SetSockAddrToRlocPeerAddrToLeaderAloc();
|
||||
messageInfo.SetSockPortToTmf();
|
||||
|
||||
SuccessOrExit(error = Get<Tmf::Agent>().SendMessage(message.PassOwnership(), messageInfo,
|
||||
HandleLeaderResponseToFwdTmf, forwardContext.Get()));
|
||||
@@ -1039,7 +1037,6 @@ void Manager::CoapDtlsSession::HandleTmfRelayTx(Coap::Msg &aMsg)
|
||||
SuccessOrExit(error = message->AppendBytesFromMessage(aMsg.mMessage, offsetRange));
|
||||
|
||||
messageInfo.SetSockAddrToRlocPeerAddrTo(joinerRouterRloc);
|
||||
messageInfo.SetSockPortToTmf();
|
||||
|
||||
SuccessOrExit(error = Get<Tmf::Agent>().SendMessage(message.PassOwnership(), messageInfo));
|
||||
|
||||
|
||||
@@ -107,11 +107,6 @@ public:
|
||||
SetPeerPort(kUdpPort);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the local socket port to TMF port.
|
||||
*/
|
||||
void SetSockPortToTmf(void) { SetSockPort(kUdpPort); }
|
||||
|
||||
/**
|
||||
* Sets the local socket address to mesh-local RLOC address.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user