]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: do not reject datagrams matching minimum permitted size
authorWilly Tarreau <w@1wt.eu>
Fri, 5 Aug 2022 08:09:32 +0000 (10:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 5 Aug 2022 08:31:29 +0000 (10:31 +0200)
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.

src/xprt_quic.c

index a6e257d7afa6b68ab4dc86e0fdc0175cc1258bbe..4046b670c67d30ad73dabde78e4f52b39914b822 100644 (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;