From 2e86547e97af80a3020d39cada3a04db7ad579fd Mon Sep 17 00:00:00 2001 From: bjdgy Date: Sun, 31 Dec 2023 22:39:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20DPD-REQ=20=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/handler/link_cstp.go | 3 ++- server/handler/link_dtls.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/server/handler/link_cstp.go b/server/handler/link_cstp.go index fa4d601..3b79d6b 100644 --- a/server/handler/link_cstp.go +++ b/server/handler/link_cstp.go @@ -75,6 +75,7 @@ func LinkCstp(conn net.Conn, bufRW *bufio.ReadWriter, cSess *sessdata.ConnSessio case 0x03: // DPD-REQ // base.Debug("recv DPD-REQ", cSess.IpAddr) pl.PType = 0x04 + pl.Data = pl.Data[:n] if payloadOutCstp(cSess, pl) { return } @@ -168,7 +169,7 @@ func cstpWrite(conn net.Conn, bufRW *bufio.ReadWriter, cSess *sessdata.ConnSessi binary.BigEndian.PutUint16(pl.Data[4:6], uint16(l)) } } else { - pl.Data = append(pl.Data[:0], plHeader...) + // pl.Data = append(pl.Data[:0], plHeader...) // 设置头类型 pl.Data[6] = pl.PType } diff --git a/server/handler/link_dtls.go b/server/handler/link_dtls.go index 2656855..fbf5015 100644 --- a/server/handler/link_dtls.go +++ b/server/handler/link_dtls.go @@ -150,6 +150,7 @@ func dtlsWrite(conn net.Conn, dSess *sessdata.DtlsSession, cSess *sessdata.ConnS } } else { // 设置头类型 + // pl.Data = append(pl.Data[:0], pl.PType) pl.Data[0] = pl.PType } n, err := conn.Write(pl.Data)