diff --git a/include/openthread/dns.h b/include/openthread/dns.h index 9f06195ec..f1008f6a4 100644 --- a/include/openthread/dns.h +++ b/include/openthread/dns.h @@ -54,8 +54,8 @@ extern "C" { #define OT_DNS_MAX_HOSTNAME_LENGTH 62 ///< Maximum allowed hostname length (maximum label size - 1 for compression). -#define OT_DNS_DEFAULT_DNS_SERVER_IP "2001:4860:4860::8888" ///< Defines default DNS Server address - Google DNS. -#define OT_DNS_DEFAULT_DNS_SERVER_PORT 53 ///< Defines default DNS Server port. +#define OT_DNS_DEFAULT_SERVER_IP "2001:4860:4860::8888" ///< Defines default DNS Server address - Google DNS. +#define OT_DNS_DEFAULT_SERVER_PORT 53 ///< Defines default DNS Server port. /** * This structure implements DNS Query parameters. diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index f395abfb1..1d70ebd92 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -797,7 +797,7 @@ exit: void Interpreter::ProcessDns(int argc, char *argv[]) { otError error = OT_ERROR_NONE; - long port = OT_DNS_DEFAULT_DNS_SERVER_PORT; + long port = OT_DNS_DEFAULT_SERVER_PORT; Ip6::MessageInfo messageInfo; otDnsQuery query; @@ -820,7 +820,7 @@ void Interpreter::ProcessDns(int argc, char *argv[]) else { // Use IPv6 address of default DNS server. - SuccessOrExit(error = messageInfo.GetPeerAddr().FromString(OT_DNS_DEFAULT_DNS_SERVER_IP)); + SuccessOrExit(error = messageInfo.GetPeerAddr().FromString(OT_DNS_DEFAULT_SERVER_IP)); } if (argc > 3) diff --git a/src/core/api/dns_api.cpp b/src/core/api/dns_api.cpp index 5b015838f..0482f4735 100644 --- a/src/core/api/dns_api.cpp +++ b/src/core/api/dns_api.cpp @@ -28,7 +28,7 @@ /** * @file - * This file implements the OpenThread UDP API. + * This file implements the OpenThread DNSv6 API. */ #include "openthread-core-config.h" diff --git a/src/core/net/dns_client.cpp b/src/core/net/dns_client.cpp index 051c09199..a53ced747 100644 --- a/src/core/net/dns_client.cpp +++ b/src/core/net/dns_client.cpp @@ -471,10 +471,7 @@ void Client::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessag VerifyOrExit((message = FindRelatedQuery(responseHeader, queryMetadata)) != NULL); - if (responseHeader.GetResponseCode() != Header::kResponseSuccess) - { - ExitNow(error = OT_ERROR_FAILED); - } + VerifyOrExit(responseHeader.GetResponseCode() == Header::kResponseSuccess, error = OT_ERROR_FAILED); // Parse and check the question section. SuccessOrExit(error = CompareQuestions(aMessage, *message, offset)); diff --git a/src/core/net/dns_client.hpp b/src/core/net/dns_client.hpp index 7db5bc5a8..14bec05a1 100644 --- a/src/core/net/dns_client.hpp +++ b/src/core/net/dns_client.hpp @@ -193,14 +193,6 @@ public: */ otError Query(const otDnsQuery *aQuery, otDnsResponseHandler aHandler, void *aContext); - /** - * This method returns a port number used by DNS client. - * - * @returns A port number. - * - */ - uint16_t GetPort(void) { return mSocket.GetSockName().mPort; }; - private: /** * Retransmission parameters.