mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
make sure packet size is multiple of 16 bytes
This commit is contained in:
parent
47c3d5ed23
commit
647bb501d1
@ -1094,6 +1094,8 @@ namespace transport
|
|||||||
{
|
{
|
||||||
uint8_t buf[SSU_MTU_V4 + 18];
|
uint8_t buf[SSU_MTU_V4 + 18];
|
||||||
size_t msgSize = len + sizeof (SSUHeader);
|
size_t msgSize = len + sizeof (SSUHeader);
|
||||||
|
size_t paddingSize = msgSize >> 4; // %16
|
||||||
|
if (paddingSize > 0) msgSize += (16 - paddingSize);
|
||||||
if (msgSize > SSU_MTU_V4)
|
if (msgSize > SSU_MTU_V4)
|
||||||
{
|
{
|
||||||
LogPrint (eLogWarning, "SSU payload size ", msgSize, " exceeds MTU");
|
LogPrint (eLogWarning, "SSU payload size ", msgSize, " exceeds MTU");
|
||||||
|
Loading…
Reference in New Issue
Block a user