Browse Source

make sure packet size is multiple of 16 bytes

pull/165/head
orignal 10 years ago
parent
commit
647bb501d1
  1. 2
      SSUSession.cpp

2
SSUSession.cpp

@ -1094,6 +1094,8 @@ namespace transport @@ -1094,6 +1094,8 @@ namespace transport
{
uint8_t buf[SSU_MTU_V4 + 18];
size_t msgSize = len + sizeof (SSUHeader);
size_t paddingSize = msgSize >> 4; // %16
if (paddingSize > 0) msgSize += (16 - paddingSize);
if (msgSize > SSU_MTU_V4)
{
LogPrint (eLogWarning, "SSU payload size ", msgSize, " exceeds MTU");

Loading…
Cancel
Save