Skip to content

Commit 1410a87

Browse files
akampmannAlexandru Kampmann
andauthored
If the first remote locator is not located on the embeddedRTPS subnet, an incorrect deserialization failure is return, which breaks SPDP (#15)
Co-authored-by: Alexandru Kampmann <[email protected]>
1 parent 68915c8 commit 1410a87

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

include/rtps/storages/MemoryPool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ template <class TYPE, uint32_t SIZE> class MemoryPool {
101101

102102
bool add(const TYPE &data) {
103103
if (isFull()) {
104+
printf("[MemoryPool] RESSOURCE LIMIT EXCEEDED \n");
104105
return false;
105106
}
106107
for (uint8_t bucket = 0; bucket < sizeof(m_bitMap); ++bucket) {

src/discovery/ParticipantProxyData.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,17 @@ bool ParticipantProxyData::readLocatorIntoList(
174174
full_length_locator.isMulticastAddress()) {
175175
proxy_locator = LocatorIPv4(full_length_locator);
176176
SPDP_LOG("Adding locator: %u %u %u %u \n",
177-
(int)proxy_locator.address[12], (int)proxy_locator.address[13],
178-
(int)proxy_locator.address[14],
179-
(int)proxy_locator.address[15]);
177+
(int)proxy_locator.address[0], (int)proxy_locator.address[1],
178+
(int)proxy_locator.address[2],
179+
(int)proxy_locator.address[3]);
180180
return true;
181181
} else {
182182
SPDP_LOG("Ignoring locator: %u %u %u %u \n",
183183
(int)full_length_locator.address[12],
184184
(int)full_length_locator.address[13],
185185
(int)full_length_locator.address[14],
186186
(int)full_length_locator.address[15]);
187-
return false;
187+
return true;
188188
}
189189
} else {
190190
valid_locators++;

src/messages/MessageTypes.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,6 @@ bool rtps::deserializeMessage(const MessageProcessingInfo &info,
166166
}
167167

168168
if (msg.readerSNState.numBits != 0) {
169-
if (4 * ((msg.readerSNState.numBits / 32) + 1) >
170-
msg.readerSNState.bitMap.size()) {
171-
while (1)
172-
;
173-
}
174169
doCopyAndMoveOn(
175170
reinterpret_cast<uint8_t *>(msg.readerSNState.bitMap.data()),
176171
currentPos, 4 * ((msg.readerSNState.numBits / 32) + 1));

0 commit comments

Comments
 (0)