[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:
Abtin Keshavarzian
2026-02-25 00:13:45 -06:00
committed by GitHub
parent 89276c01fc
commit 2f975ae86b
2 changed files with 0 additions and 8 deletions
-3
View File
@@ -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));
-5
View File
@@ -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.
*/