client-interface-cleanup #6

Merged
johnnylee merged 14 commits from client-interface-cleanup into main 2025-09-17 08:00:13 +00:00
Showing only changes of commit a0b7ecbfe0 - Show all commits

View File

@ -163,24 +163,21 @@ func (r *remoteFSM) stateServer_onSyn(msg controlMsg[packetSyn]) {
r.lastSeen = time.Now() r.lastSeen = time.Now()
p := msg.Packet p := msg.Packet
if p.TraceID == r.traceID {
return
}
r.traceID = p.TraceID
// Before we can respond to this packet, we need to make sure the
// route is setup properly.
conf := r.conf() conf := r.conf()
conf.Up = true // New trace ID => Update the route configuration.
conf.Direct = p.Direct if p.TraceID != r.traceID {
conf.DirectAddr = msg.SrcAddr r.traceID = p.TraceID
conf.DataCipher = newDataCipherFromKey(p.SharedKey) conf.Up = true
conf.Direct = p.Direct
conf.DirectAddr = msg.SrcAddr
r.updateConf(conf) conf.DataCipher = newDataCipherFromKey(p.SharedKey)
r.logf("Got SYN.")
r.updateConf(conf)
r.logf("Got SYN.")
}
r.sendControl(conf, packetAck{ r.sendControl(conf, packetAck{
TraceID: p.TraceID, TraceID: p.TraceID,