Cleanup / temp buffers for various things

This commit is contained in:
jdl
2026-06-12 14:16:38 +02:00
parent 6856727985
commit 4d2aa5c8c7
10 changed files with 30 additions and 17 deletions

View File

@@ -23,6 +23,10 @@ const (
TimeoutInterval = 30 * time.Second
)
// scratchSize is large enough for the biggest buffer either the ping or the
// multicast path serializes through the shared App scratch.
const scratchSize = max(control.Size, multicast.SignedPacketSize)
type PingEvent struct {
srcVPNIP netip.Addr
ping control.Ping
@@ -53,8 +57,9 @@ type App struct {
selfV4 netip.AddrPort
selfV6 netip.AddrPort
// Reusable scratch for multicast signature verification (event loop only).
mcVerifyBuf []byte
// Reusable serialization scratch for outgoing pings and multicast signature
// verification. Only touched from the Run goroutine.
scratch []byte
// Event channels fed by background goroutines
hubAddCh <-chan m.Peer