diff --git a/src/core/coap/coap.hpp b/src/core/coap/coap.hpp index 4e35dd1bb..14bac1f81 100644 --- a/src/core/coap/coap.hpp +++ b/src/core/coap/coap.hpp @@ -485,14 +485,6 @@ public: */ otError Stop(void); - /** - * This method returns a port number used by CoAP service. - * - * @returns A port number. - * - */ - uint16_t GetPort(void) { return mSocket.GetSockName().mPort; }; - /** * This method adds a resource to the CoAP server. * diff --git a/src/core/meshcop/joiner.cpp b/src/core/meshcop/joiner.cpp index 58950e95c..7b959d8cd 100644 --- a/src/core/meshcop/joiner.cpp +++ b/src/core/meshcop/joiner.cpp @@ -159,7 +159,7 @@ void Joiner::Close(void) ThreadNetif &netif = GetNetif(); netif.GetCoapSecure().Disconnect(); - netif.GetIp6Filter().RemoveUnsecurePort(netif.GetCoapSecure().GetPort()); + netif.GetIp6Filter().RemoveUnsecurePort(OPENTHREAD_CONFIG_JOINER_UDP_PORT); } void Joiner::Complete(otError aError) @@ -290,7 +290,7 @@ otError Joiner::TryNextJoin() netif.GetMac().SetPanId(joinerRouter->mPanId); netif.GetMac().SetPanChannel(joinerRouter->mChannel); - netif.GetIp6Filter().AddUnsecurePort(netif.GetCoapSecure().GetPort()); + netif.GetIp6Filter().AddUnsecurePort(OPENTHREAD_CONFIG_JOINER_UDP_PORT); messageInfo.GetPeerAddr().mFields.m16[0] = HostSwap16(0xfe80); messageInfo.GetPeerAddr().SetIid(joinerRouter->mExtAddr);