BUG/MINOR: quic: do not reject datagrams matching minimum permitted size

The dgram length check in quic_get_dgram_dcid() rejects datagrams
matching exactly the minimum allowed length, which doesn't seem
correct. I doubt any useful packet would be that small but better
fix this to avoid confusing debugging sessions in the future.

This might be backported to 2.6.
This commit is contained in:
Willy Tarreau 2022-08-05 10:09:32 +02:00
parent 53bfab080c
commit af5138fd07

View File

@ -6615,7 +6615,7 @@ int quic_get_dgram_dcid(unsigned char *buf, const unsigned char *end,
minlen = long_header ? QUIC_LONG_PACKET_MINLEN :
QUIC_SHORT_PACKET_MINLEN + QUIC_HAP_CID_LEN + QUIC_TLS_TAG_LEN;
skip = long_header ? QUIC_LONG_PACKET_DCID_OFF : QUIC_SHORT_PACKET_DCID_OFF;
if (end - buf <= minlen)
if (end - buf < minlen)
goto err;
buf += skip;