From d24717b3a2b7be054ec53877348bc131dfbd855b Mon Sep 17 00:00:00 2001 From: eProsima Date: Thu, 17 Oct 2024 16:24:49 +0200 Subject: [PATCH] Refs #21913: Add check in RTPSParticipant Signed-off-by: eProsima --- src/cpp/rtps/participant/RTPSParticipantImpl.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp index 4d2849a355..c1695e0b17 100644 --- a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp +++ b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp @@ -492,15 +492,24 @@ bool RTPSParticipantImpl::setup_transports() transportDescriptor->unlock(); + auto shm_transport_descriptor = dynamic_cast(transportDescriptor.get()); if (transport_registered) { - has_shm_transport_ |= - (dynamic_cast(transportDescriptor.get()) != nullptr); + has_shm_transport_ |= (nullptr != shm_transport_descriptor); + if (nullptr != shm_transport_descriptor) + { + if (shm_transport_descriptor->max_message_size() > 572u) + { + EPROSIMA_LOG_ERROR(RTPS_PARTICIPANT, + "Unable to Register SHM Transport. Maximum message size needs to be" + "equal or higher than the PDP package size."); + } + } } else { // SHM transport could be disabled - if ((dynamic_cast(transportDescriptor.get()) != nullptr)) + if (nullptr != shm_transport_descriptor) { EPROSIMA_LOG_ERROR(RTPS_PARTICIPANT, "Unable to Register SHM Transport. SHM Transport is not supported in"