This commit is contained in:
JackDoan
2026-08-04 09:03:40 -05:00
parent 3b1004588d
commit a3eef407b2
11 changed files with 163 additions and 366 deletions
+6 -8
View File
@@ -14,14 +14,12 @@ import (
const ReplayWindow = 8192
// sessionEpoch hands out a receiver-local ordinal to every ConnectionState as
// it is created. The RX staging sort (overlay/batch) orders packets by
// (epoch, message counter). A re-handshake never rekeys an existing tunnel; it
// brings up a whole new hostinfo (and ConnectionState) with its own counter
// space starting near zero, while the old tunnel keeps decrypting in-flight
// packets until it is torn down. During that cutover one flush batch can hold
// packets from both tunnels, and the epoch is what keeps the old tunnel's
// packets sorted ahead of the new tunnel's.
// sessionEpoch hands out a receiver-local ordinal to every ConnectionState at creation. The RX
// staging sort (overlay/batch) orders packets by (epoch, message counter). A re-handshake never
// rekeys an existing tunnel; it brings up a new hostinfo and ConnectionState with a counter space
// starting near zero, while the old tunnel keeps decrypting until torn down. During that cutover
// one flush batch can hold packets from both tunnels, and the epoch keeps the old tunnel's
// packets sorted first.
var sessionEpoch atomic.Uint64
type ConnectionState struct {