Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[22440] Malformed packets in Fast DDS 3 (backport #5466) #5471

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/cpp/rtps/messages/RTPSMessageGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@

#include <statistics/rtps/messages/RTPSStatisticsMessages.hpp>

#ifdef FASTDDS_STATISTICS
const size_t max_boost_buffers = 61; // ... + SubMsg header + SubMsg body + Statistics message
#else
const size_t max_boost_buffers = 62; // ... + SubMsg header + SubMsg body
#endif // ifdef FASTDDS_STATISTICS

namespace eprosima {
namespace fastdds {
namespace rtps {
Expand Down Expand Up @@ -454,8 +460,8 @@ bool RTPSMessageGroup::insert_submessage(
return false;
}

// Messages with a submessage bigger than 64KB cannot have more submessages and should be flushed
if (is_big_submessage)
// Flush when the submessage is bigger than 64KB OR if the number of buffers to send is 64 (boost limit)
if (is_big_submessage || max_boost_buffers < buffers_to_send_->size())
{
flush();
}
Expand Down
5 changes: 5 additions & 0 deletions src/cpp/rtps/transport/UDPTransportInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,11 @@ bool UDPTransportInterface::send(
EPROSIMA_LOG_WARNING(TRANSPORT_UDP, ec.message());
return false;
}

if (bytesSent != total_bytes)
{
EPROSIMA_LOG_WARNING(TRANSPORT_UDP, "Boost send_to wasn't able to send all bytes");
}
}
catch (const std::exception& error)
{
Expand Down
Loading