QUIC sniffer: Handle zero-filled datagram tails (#6882)

https://github.com/XTLS/Xray-core/pull/6882#pullrequestreview-5395639793

---------

Co-authored-by: 风扇滑翔翼 <Fangliding.fshxy@outlook.com>
This commit is contained in:
Filipp Balakin
2026-10-05 03:53:22 +00:00
committed by GitHub
co-authored by 风扇滑翔翼
parent 92f7e72490
commit 5121c28b85
2 changed files with 22 additions and 0 deletions
+4
View File
@@ -146,6 +146,10 @@ func SniffQUIC(b []byte) (*SniffHeader, error) {
}
restPayload := b[hdrLen+int(packetLen):]
// cachedReader can concatenate zero-padded UDP datagrams.
for len(restPayload) > 0 && restPayload[0] == 0 {
restPayload = restPayload[1:]
}
if !isQUICInitial { // Skip this packet if it's not initial packet
b = restPayload
continue
File diff suppressed because one or more lines are too long