Send by the relay when hybrid msg3 came by one, the direct address learned from msg1 may only work toward us

This commit is contained in:
JackDoan committed 2026-10-14 15:41:03 -05:00
1 parent bd82089a3f
commit 437d47ffc5
2 files changed
+62

No files matched your search

+5
View File
@@ -255,9 +255,14 @@ func (hm *HandshakeManager) completeHybridResponder(via ViaSender, hh *Handshake
hostinfo.ConnectionState = cs
hostinfo.remoteIndexId = result.RemoteIndex
hostinfo.lastHandshakeTime = result.HandshakeTime
// The initiator sends msg3 by the path its msg2 got through, so that path
// works both ways: send by it. A relayed msg3 also means the direct address
// learned from msg1 may only work toward us, so forget it and let traffic,
// the confirmation first, go by the relay.
if !via.IsRelayed {
hostinfo.SetRemote(via.UdpAddr)
} else {
hostinfo.remote.Store(nil)
hostinfo.relayState.InsertRelayTo(via.relayHI.vpnAddrs[0])
}
remoteCert := result.RemoteCert