WIP: Apparently working?

This commit is contained in:
jdl
2025-08-26 16:11:21 +02:00
parent ab246b2a90
commit 169231d848
7 changed files with 21 additions and 29 deletions

View File

@@ -156,16 +156,13 @@ func (r *remoteFSM) stateServer_onInit(msg controlMsg[packetInit]) {
}
func (r *remoteFSM) stateServer_onSyn(msg controlMsg[packetSyn]) {
r.logf("Got SYN: %v", msg.Packet)
r.lastSeen = time.Now()
p := msg.Packet
// Before we can respond to this packet, we need to make sure the
// route is setup properly.
conf := r.conf()
if !conf.Up || conf.Direct != p.Direct {
r.logf("Got SYN.")
}
logSyn := !conf.Up || conf.Direct != p.Direct
conf.Up = true
conf.Direct = p.Direct
@@ -179,6 +176,10 @@ func (r *remoteFSM) stateServer_onSyn(msg controlMsg[packetSyn]) {
r.updateConf(conf)
if logSyn {
r.logf("Got SYN.")
}
r.sendControl(conf, packetAck{
TraceID: p.TraceID,
ToAddr: conf.DirectAddr,
@@ -429,7 +430,6 @@ func (r *remoteFSM) stateClient_onPingTimer() stateFunc {
return r.enterClientInit()
}
r.traceID = newTraceID()
r.stateClient_sendSyn(conf)
return r.stateClient
}