From 2897388568b68bb8d8de329eecce6e64dc361e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A5=E4=B8=8B=E9=83=A8=20=E8=A9=A9?= Date: Tue, 5 Sep 2023 12:33:41 +0800 Subject: [PATCH] fix TTL --- device/receivesendproc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/receivesendproc.go b/device/receivesendproc.go index 25627be..2d9b921 100644 --- a/device/receivesendproc.go +++ b/device/receivesendproc.go @@ -934,7 +934,7 @@ func (device *Device) RoutinePostPeerInfo(startchan <-chan struct{}) { Src_nodeID: id, Dst_nodeID: device.ID, Timediff: peer.SingleWayLatency.GetVal(), - TimeToAlive: time.Since(*peer.LastPacketReceivedAdd1Sec.Load().(*time.Time)).Seconds() + device.EdgeConfig.DynamicRoute.PeerAliveTimeout, + TimeToAlive: -time.Since(*peer.LastPacketReceivedAdd1Sec.Load().(*time.Time)).Seconds() + device.EdgeConfig.DynamicRoute.PeerAliveTimeout, } pongs = append(pongs, pong) if device.LogLevel.LogControl {