From 6e69211056fd18d004278254cdc17c4d0a2bdc4e Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Thu, 6 Apr 2023 18:09:59 +0200 Subject: [PATCH] Refs #18002. Update metatraffic_unicast_port_ inside applyLocatorAdaptRule. Signed-off-by: Miguel Company --- src/cpp/rtps/participant/RTPSParticipantImpl.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp index e774e572052..f06162c02f2 100644 --- a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp +++ b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp @@ -236,7 +236,12 @@ Locator_t& RTPSParticipantImpl::applyLocatorAdaptRule( { // This is a completely made up rule // It is transport responsibility to interpret this new port. - loc.port += m_att.port.participantIDGain; + uint16_t delta = m_att.port.participantIDGain; + if (metatraffic_unicast_port_ == loc.port) + { + metatraffic_unicast_port_ += delta; + } + loc.port += delta; return loc; }