cap RX buffers in UDP rather than callers

This commit is contained in:
JackDoan
2026-07-31 13:58:52 -05:00
parent d7bcfb5d6b
commit bc70bf47f8
7 changed files with 15 additions and 8 deletions
+1 -1
View File
@@ -231,7 +231,7 @@ func (f *Interface) handleOutsideRelayPacket(hostinfo *HostInfo, via ViaSender,
case ForwardingType:
// Forward this packet through the relay tunnel, rebuilding it in place.
// Encode overwrites the old outer header, and the new AEAD tag lands where the old one was
fwdBuf := packet[:0:len(packet)] // Cap to len(packet) to protect memory from a larger parent buffer
fwdBuf := packet[:0]
//todo it would potentially be nice to batch these
f.SendVia(targetHI, targetRelay, signedPayload, nb, fwdBuf, true, q)
case TerminalType: