diff --git a/src/core/net/sntp_client.cpp b/src/core/net/sntp_client.cpp index 2ba966742..575472179 100644 --- a/src/core/net/sntp_client.cpp +++ b/src/core/net/sntp_client.cpp @@ -347,10 +347,10 @@ void Client::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessag // Check the Kiss-o'-death packet. if (!responseHeader.GetStratum()) { - char kissCode[Header::GetKissCodeLength() + 1]; + char kissCode[Header::kKissCodeLength + 1]; - memcpy(kissCode, responseHeader.GetKissCode(), Header::GetKissCodeLength()); - kissCode[Header::GetKissCodeLength()] = 0; + memcpy(kissCode, responseHeader.GetKissCode(), Header::kKissCodeLength); + kissCode[Header::kKissCodeLength] = 0; otLogInfoIp6("SNTP response contains the Kiss-o'-death packet with %s code", kissCode); ExitNow(error = OT_ERROR_BUSY); diff --git a/src/core/net/sntp_client.hpp b/src/core/net/sntp_client.hpp index 6af1ed909..ccef720aa 100644 --- a/src/core/net/sntp_client.hpp +++ b/src/core/net/sntp_client.hpp @@ -31,6 +31,7 @@ #include "openthread-core-config.h" +#include #include #include "common/message.hpp" @@ -76,6 +77,15 @@ public: kModeServer = 4, }; + /** + * Kiss code length. + * + */ + enum + { + kKissCodeLength = 4, ///< Length of the kiss code in ASCII format + }; + /** * This method returns the flags field value. * @@ -204,14 +214,6 @@ public: */ char *GetKissCode(void) { return reinterpret_cast(&mReferenceId); } - /** - * This method returns the length of the kiss code in ASCII format. - * - * @returns The length of the kiss code in ASCII format. - * - */ - static uint16_t GetKissCodeLength(void) { return sizeof(uint32_t); }; - /** * This method returns the reference timestamp seconds field. * diff --git a/third_party/NordicSemiconductor/libraries/crypto/nrf52840-mbedtls-config.h b/third_party/NordicSemiconductor/libraries/crypto/nrf52840-mbedtls-config.h index 0aeb396af..6ae51322c 100644 --- a/third_party/NordicSemiconductor/libraries/crypto/nrf52840-mbedtls-config.h +++ b/third_party/NordicSemiconductor/libraries/crypto/nrf52840-mbedtls-config.h @@ -38,4 +38,5 @@ #if defined(__CC_ARM) _Pragma("diag_suppress=550") + _Pragma("diag_suppress=68") #endif