From 0a0b2404a23be29bd5a458beb6b3b0ff154e9098 Mon Sep 17 00:00:00 2001 From: JackDoan Date: Wed, 15 Jul 2026 09:34:50 -0500 Subject: [PATCH] put locks around the replay window --- outside.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/outside.go b/outside.go index fcdb4f34..0fbc5a65 100644 --- a/outside.go +++ b/outside.go @@ -117,7 +117,8 @@ func (f *Interface) readOutsidePackets(via ViaSender, scratch []byte, packet []b // All remaining packets are encrypted if isMessageRelay { // Relay packets are special, this branch should always early-return - if err = hostinfo.ConnectionState.VerifyRelay(f.l, h.MessageCounter, packet, nb); err != nil { + err = hostinfo.ConnectionState.VerifyRelay(f.l, h.MessageCounter, packet, nb) + if err != nil { if f.l.Enabled(context.Background(), slog.LevelDebug) { hostinfo.logger(f.l).Debug("Failed to verify relay packet", "error", err, "from", via, "header", h) } @@ -197,9 +198,7 @@ func (f *Interface) handleOutsideRelayPacket(hostinfo *HostInfo, via ViaSender, if !ok { // The only way this happens is if hostmap has an index to the correct HostInfo, but the HostInfo is missing // its internal mapping. This should never happen. - hostinfo.logger(f.l).Error("HostInfo missing remote relay index", - "relayRemoteIndex", h.RemoteIndex, - ) + hostinfo.logger(f.l).Error("HostInfo missing remote relay index", "relayRemoteIndex", h.RemoteIndex) return }