nfqws: QUIC check fixed bit = 1

This commit is contained in:
bol-van 2022-03-26 21:09:15 +03:00
parent 2eec88c2bf
commit 1111845590

View File

@ -525,9 +525,9 @@ bool QUICExtractHostFromInitial(const uint8_t *data, size_t data_len, char *host
bool IsQUICInitial(const uint8_t *data, size_t len)
{
// too small packets are not likely to be initials with client hello
if (len < 256) return false;
// long header, fixed bit
if (len < 256 || (data[0] & 0xC0)!=0xC0) return false;
// this also ensures long header
uint32_t ver = QUICExtractVersion(data,len);
if (QUICDraftVersion(ver) < 11) return false;