From 1a3ef97ede1578de134e84ff4810b8d2472d78ca Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Thu, 22 Apr 2021 16:30:47 -0700 Subject: [PATCH] Return correct error code when sending large ping --- examples/shell/shell_common/cmd_ping.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/shell/shell_common/cmd_ping.cpp b/examples/shell/shell_common/cmd_ping.cpp index d399a24f23bfc6..471b37561f166f 100644 --- a/examples/shell/shell_common/cmd_ping.cpp +++ b/examples/shell/shell_common/cmd_ping.cpp @@ -161,7 +161,7 @@ CHIP_ERROR SendEchoRequest(streamer_t * stream) char * requestData = nullptr; uint32_t size = gPingArguments.GetEchoReqSize(); - VerifyOrExit(size <= kMaxPayloadSize, err = CHIP_ERROR_INVALID_MESSAGE_LENGTH); + VerifyOrExit(size <= kMaxPayloadSize, err = CHIP_ERROR_MESSAGE_TOO_LONG); requestData = static_cast(chip::Platform::MemoryAlloc(size)); VerifyOrExit(requestData != nullptr, err = CHIP_ERROR_NO_MEMORY);