From 86d541066bd86600f48c4c7430962a1876bd703b Mon Sep 17 00:00:00 2001 From: jepenven-silabs <67962328+jepenven-silabs@users.noreply.github.com> Date: Fri, 5 Nov 2021 15:33:23 -0400 Subject: [PATCH] [Group] Add Ack check in group msg (#11472) * Add Ack check in group msg --- src/transport/SessionManager.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index ad291f5054f2c9..d3d0e80df9f950 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -488,17 +488,24 @@ void SessionManager::SecureGroupMessageDispatch(const PacketHeader & packetHeade ExitNow(err = CHIP_NO_ERROR); } + // Group Messages should never send an Ack + if (payloadHeader.NeedsAck()) + { + ChipLogError(Inet, "Unexpected ACK requested for group message"); + ExitNow(err = CHIP_ERROR_INCORRECT_STATE); + } + // TODO: Handle Group message counter here spec 4.7.3 // spec 4.5.1.2 for msg counter + if (isDuplicate == SessionManagerDelegate::DuplicateMessage::Yes) { ChipLogDetail(Inet, "Received a duplicate message with MessageCounter:" ChipLogFormatMessageCounter " on exchange " ChipLogFormatExchangeId, - packetHeader.GetMessageCounter(), ChipLogValueExchangeIdFromSentHeader(payloadHeader)); + packetHeader.GetMessageCounter(), ChipLogValueExchangeIdFromReceivedHeader(payloadHeader)); - // If it's a duplicate message, let's drop it right here to save CPU - // cycles on further message processing. + // If it's a duplicate message, let's drop it right here to save CPU cycles ExitNow(err = CHIP_NO_ERROR); }