mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-13 15:27:52 +00: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];
|
||||
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…
Reference in New Issue
Block a user