From 1455582b86441d823b66358f26d4d7161985b2e0 Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Fri, 23 Apr 2021 06:24:14 -0700 Subject: [PATCH] Return correct error code when sending large ping (#6244) --- 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);