Browse Source

allocate tunnel message buffer for I2NP block with tunnel data message type

pull/1786/head
orignal 2 years ago
parent
commit
cb959ab14c
  1. 2
      libi2pd/SSU2Session.cpp

2
libi2pd/SSU2Session.cpp

@ -1320,7 +1320,7 @@ namespace transport
case eSSU2BlkI2NPMessage: case eSSU2BlkI2NPMessage:
{ {
LogPrint (eLogDebug, "SSU2: I2NP message"); LogPrint (eLogDebug, "SSU2: I2NP message");
auto nextMsg = NewI2NPShortMessage (); auto nextMsg = (buf[offset] == eI2NPTunnelData) ? NewI2NPTunnelMessage (true) : NewI2NPShortMessage ();
nextMsg->len = nextMsg->offset + size + 7; // 7 more bytes for full I2NP header nextMsg->len = nextMsg->offset + size + 7; // 7 more bytes for full I2NP header
memcpy (nextMsg->GetNTCP2Header (), buf + offset, size); memcpy (nextMsg->GetNTCP2Header (), buf + offset, size);
nextMsg->FromNTCP2 (); // SSU2 has the same format as NTCP2 nextMsg->FromNTCP2 (); // SSU2 has the same format as NTCP2

Loading…
Cancel
Save