mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-09-07 23:05:30 +00:00
Merge pull request #2539 from pobregat0/tunnel-short-message
Drop a tunnel message shorter than an I2NP header
This commit is contained in:
@@ -322,6 +322,12 @@ namespace tunnel
|
||||
LogPrint (eLogInfo, "TunnelMessage: Message expired");
|
||||
return;
|
||||
}
|
||||
if (msg.data->GetLength () < I2NP_HEADER_SIZE)
|
||||
{
|
||||
// GetPayloadLength subtracts the header size, a shorter message wraps it around
|
||||
LogPrint (eLogError, "TunnelMessage: Message of ", msg.data->GetLength (), " bytes is shorter than I2NP header, dropped");
|
||||
return;
|
||||
}
|
||||
uint8_t typeID = msg.data->GetTypeID ();
|
||||
LogPrint (eLogDebug, "TunnelMessage: Handle fragment of ", msg.data->GetLength (), " bytes, msg type ", (int)typeID);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user