From 869224c157b72bf61647d03ecf9eb8c76b0bb73e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 12 Apr 2022 22:50:11 +0800 Subject: [PATCH] Fix ss 2022 lastRemoteSeen --- protocol/shadowsocks/shadowaead_2022/protocol.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/protocol/shadowsocks/shadowaead_2022/protocol.go b/protocol/shadowsocks/shadowaead_2022/protocol.go index 8fc84ce..50ce702 100644 --- a/protocol/shadowsocks/shadowaead_2022/protocol.go +++ b/protocol/shadowsocks/shadowaead_2022/protocol.go @@ -441,7 +441,6 @@ func (c *clientPacketConn) ReadPacket(buffer *buf.Buffer) (*M.AddrPort, error) { if !c.session.filter.ValidateCounter(packetId, math.MaxUint64) { return nil, ErrPacketIdNotUnique } - c.session.remoteSeen = time.Now().Unix() } else if sessionId == c.session.lastRemoteSessionId { if !c.session.lastFilter.ValidateCounter(packetId, math.MaxUint64) { return nil, ErrPacketIdNotUnique @@ -455,14 +454,13 @@ func (c *clientPacketConn) ReadPacket(buffer *buf.Buffer) (*M.AddrPort, error) { } else { c.session.lastRemoteSessionId = c.session.remoteSessionId c.session.lastFilter = c.session.filter - c.session.lastRemoteSeen = c.session.remoteSeen + c.session.lastRemoteSeen = time.Now().Unix() c.session.lastRemoteCipher = c.session.remoteCipher c.session.filter = new(wgReplay.Filter) } } c.session.remoteSessionId = sessionId c.session.remoteCipher = remoteCipher - c.session.remoteSeen = time.Now().Unix() c.session.filter.ValidateCounter(packetId, math.MaxUint64) } @@ -491,7 +489,6 @@ type udpSession struct { packetId uint64 remoteSessionId uint64 lastRemoteSessionId uint64 - remoteSeen int64 lastRemoteSeen int64 cipher cipher.AEAD remoteCipher cipher.AEAD