diff --git a/src/transport/SecureSessionMgr.cpp b/src/transport/SecureSessionMgr.cpp index 5d1061d7c03860..006ad3396e937f 100644 --- a/src/transport/SecureSessionMgr.cpp +++ b/src/transport/SecureSessionMgr.cpp @@ -122,9 +122,12 @@ CHIP_ERROR SecureSessionMgr::PrepareMessage(SessionHandle session, PayloadHeader MessageCounter & counter = GetSendCounterForPacket(payloadHeader, *state); ReturnErrorOnFailure(SecureMessageCodec::Encode(state, payloadHeader, packetHeader, message, counter)); - ChipLogProgress(Inet, "Build %s message %p to 0x" ChipLogFormatX64 " of type %d and protocolId %" PRIu32 " on exchange %d with MessageId %" PRIu32 ".", + ChipLogProgress(Inet, + "Build %s message %p to 0x" ChipLogFormatX64 " of type %d and protocolId %" PRIu32 + " on exchange %d with MessageId %" PRIu32 ".", "encrypted", &preparedMessage, ChipLogValueX64(state->GetPeerNodeId()), payloadHeader.GetMessageType(), - payloadHeader.GetProtocolID().ToFullyQualifiedSpecForm(), payloadHeader.GetExchangeID(), packetHeader.GetMessageId()); + payloadHeader.GetProtocolID().ToFullyQualifiedSpecForm(), payloadHeader.GetExchangeID(), + packetHeader.GetMessageId()); } else { @@ -136,9 +139,12 @@ CHIP_ERROR SecureSessionMgr::PrepareMessage(SessionHandle session, PayloadHeader packetHeader.SetMessageId(messageId); - ChipLogProgress(Inet, "Build %s message %p to 0x" ChipLogFormatX64 " of type %d and protocolId %" PRIu32 " on exchange %d with MessageId %" PRIu32 ".", + ChipLogProgress(Inet, + "Build %s message %p to 0x" ChipLogFormatX64 " of type %d and protocolId %" PRIu32 + " on exchange %d with MessageId %" PRIu32 ".", "plaintext", &preparedMessage, ChipLogValueX64(kUndefinedNodeId), payloadHeader.GetMessageType(), - payloadHeader.GetProtocolID().ToFullyQualifiedSpecForm(), payloadHeader.GetExchangeID(), packetHeader.GetMessageId()); + payloadHeader.GetProtocolID().ToFullyQualifiedSpecForm(), payloadHeader.GetExchangeID(), + packetHeader.GetMessageId()); } ReturnErrorOnFailure(packetHeader.EncodeBeforeData(message)); diff --git a/src/transport/UnauthenticatedSessionTable.h b/src/transport/UnauthenticatedSessionTable.h index 6f6c0f7acf64c1..2216b1f452ba5d 100644 --- a/src/transport/UnauthenticatedSessionTable.h +++ b/src/transport/UnauthenticatedSessionTable.h @@ -175,19 +175,20 @@ class UnauthenticatedSessionTable static bool MatchPeerAddress(const PeerAddress & a1, const PeerAddress & a2) { - if (a1.GetTransportType() != a2.GetTransportType()) return false; + if (a1.GetTransportType() != a2.GetTransportType()) + return false; switch (a1.GetTransportType()) { - case Transport::Type::kUndefined: - return false; - case Transport::Type::kUdp: - case Transport::Type::kTcp: - // Ingore interface in the address - return a1.GetIPAddress() == a2.GetIPAddress() && a1.GetPort() == a2.GetPort(); - case Transport::Type::kBle: - // TODO: complete BLE address comparation - return true; + case Transport::Type::kUndefined: + return false; + case Transport::Type::kUdp: + case Transport::Type::kTcp: + // Ingore interface in the address + return a1.GetIPAddress() == a2.GetIPAddress() && a1.GetPort() == a2.GetPort(); + case Transport::Type::kBle: + // TODO: complete BLE address comparation + return true; } return false;