From a3dc54b012090256723ec11e6415ab4b94fc9cfd Mon Sep 17 00:00:00 2001 From: JackDoan Date: Wed, 14 Oct 2026 15:33:24 -0500 Subject: [PATCH] Keep a hybrid responder's reassembled msg1 rather than a copy of it --- handshake_manager_hybrid.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/handshake_manager_hybrid.go b/handshake_manager_hybrid.go index 4fee8a93..f6381e49 100644 --- a/handshake_manager_hybrid.go +++ b/handshake_manager_hybrid.go @@ -145,8 +145,9 @@ func (hm *HandshakeManager) awaitMsg3(via ViaSender, hh *HandshakeHostInfo, mach now := time.Now() hostinfo.vpnAddrs = vpnAddrs hostinfo.remoteIndexId = rh.RemoteIndex - // packet aliases the listener's incoming buffer, so this copy must stay. - hostinfo.HandshakePacket[handshakePacketStage0] = append([]byte(nil), packet[header.Len:]...) + // A hybrid msg1 is always fragmented, so packet is the one the fragment + // table reassembled, not the listener's buffer, and nothing else holds it. + hostinfo.HandshakePacket[handshakePacketStage0] = packet[header.Len:] hostinfo.HandshakePacket[handshakePacketStage2] = response hostinfo.remotes = f.lightHouse.QueryCache(vpnAddrs) if !via.IsRelayed {