Merge pull request #285 from itviewer/dev

遵循 DPD-REQ 协议,修复 OpenConnect DTLS 的 MTU 探测
This commit is contained in:
bjdgyc 2023-12-31 21:53:03 +08:00 committed by GitHub
commit 970213f269
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -64,6 +64,7 @@ func LinkDtls(conn net.Conn, cSess *sessdata.ConnSession) {
case 0x03: // DPD-REQ
// base.Debug("recv DPD-REQ", cSess.IpAddr)
pl.PType = 0x04
pl.Data = pl.Data[:n]
if payloadOutDtls(cSess, dSess, pl) {
return
}
@ -149,7 +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)
if err != nil {