Skip to content

Commit 1fbf227

Browse files
Fix logging of received message sizes.
For encrypted messages, we were not including the size of the MIC in the logged size, so the sizes logged on the send and received side were off by 16 from each other.
1 parent 9032548 commit 1fbf227

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/messaging/ExchangeMgr.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,15 @@ void ExchangeManager::OnMessageReceived(const PacketHeader & packetHeader, const
223223
//
224224
// Legend that can be used to decode this log line can be found in README.md
225225
//
226-
ChipLogProgress(
227-
ExchangeManager,
228-
">>> [E:" ChipLogFormatExchangeId " S:%u M:" ChipLogFormatMessageCounter "%s] (%s) Msg RX from %u:" ChipLogFormatX64
229-
" [%04X] --- Type %s (%s:%s) (B:%u)",
230-
ChipLogValueExchangeIdFromReceivedHeader(payloadHeader), session->SessionIdForLogging(), packetHeader.GetMessageCounter(),
231-
ackBuf, Transport::GetSessionTypeString(session), session->GetFabricIndex(),
232-
ChipLogValueX64(session->GetPeer().GetNodeId()), static_cast<uint16_t>(compressedFabricId), typeStr, protocolName,
233-
msgTypeName,
234-
static_cast<unsigned>(msgBuf->TotalLength() + packetHeader.EncodeSizeBytes() + payloadHeader.EncodeSizeBytes()));
226+
ChipLogProgress(ExchangeManager,
227+
">>> [E:" ChipLogFormatExchangeId " S:%u M:" ChipLogFormatMessageCounter
228+
"%s] (%s) Msg RX from %u:" ChipLogFormatX64 " [%04X] --- Type %s (%s:%s) (B:%u)",
229+
ChipLogValueExchangeIdFromReceivedHeader(payloadHeader), session->SessionIdForLogging(),
230+
packetHeader.GetMessageCounter(), ackBuf, Transport::GetSessionTypeString(session), session->GetFabricIndex(),
231+
ChipLogValueX64(session->GetPeer().GetNodeId()), static_cast<uint16_t>(compressedFabricId), typeStr,
232+
protocolName, msgTypeName,
233+
static_cast<unsigned>(msgBuf->TotalLength() + packetHeader.EncodeSizeBytes() + packetHeader.MICTagLength() +
234+
payloadHeader.EncodeSizeBytes()));
235235
#endif
236236

237237
MessageFlags msgFlags;

0 commit comments

Comments
 (0)