diff --git a/src/core/meshcop/joiner.cpp b/src/core/meshcop/joiner.cpp index 0173940aa..78d1d6fa8 100644 --- a/src/core/meshcop/joiner.cpp +++ b/src/core/meshcop/joiner.cpp @@ -137,7 +137,7 @@ Error Joiner::Start(const char *aPskd, Get().SetExtAddress(randomAddress); Get().UpdateLinkLocalAddress(); - SuccessOrExit(error = Get().Open()); + SuccessOrExit(error = Get().Open(Ip6::NetifIdentifier::kNetifThreadInternal)); SuccessOrExit(error = Get().Bind(kJoinerUdpPort)); Get().SetConnectCallback(HandleSecureCoapClientConnect, this); Get().SetPsk(joinerPskd); diff --git a/src/core/meshcop/secure_transport.cpp b/src/core/meshcop/secure_transport.cpp index 3ac1c89d0..a9546ad81 100644 --- a/src/core/meshcop/secure_transport.cpp +++ b/src/core/meshcop/secure_transport.cpp @@ -676,13 +676,13 @@ SecureTransport::SecureTransport(Instance &aInstance, LinkSecurityMode aLayerTwo OT_UNUSED_VARIABLE(mVerifyPeerCertificate); } -Error SecureTransport::Open(void) +Error SecureTransport::Open(Ip6::NetifIdentifier aNetifIdentifier) { Error error; VerifyOrExit(!mIsOpen, error = kErrorAlready); - SuccessOrExit(error = mSocket.Open(Ip6::kNetifUnspecified)); + SuccessOrExit(error = mSocket.Open(aNetifIdentifier)); mIsOpen = true; mRemainingConnectionAttempts = mMaxConnectionAttempts; diff --git a/src/core/meshcop/secure_transport.hpp b/src/core/meshcop/secure_transport.hpp index 63eb40444..5e2c14f0e 100644 --- a/src/core/meshcop/secure_transport.hpp +++ b/src/core/meshcop/secure_transport.hpp @@ -592,10 +592,13 @@ public: /** * Opens the transport. * + * @param[in] aNetifIdentifier A network interface identifier. If not explicitly provided, kNetifUnspecified will + * be used by default. + * * @retval kErrorNone Successfully opened the socket. * @retval kErrorAlready The connection is already open. */ - Error Open(void); + Error Open(Ip6::NetifIdentifier aNetifIdentifier = Ip6::NetifIdentifier::kNetifUnspecified); /** * Sets the maximum number of allowed connection requests before socket is automatically closed.