Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Group] Add Ack check in group msg #11472

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/transport/SessionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down