]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: No DCID length for datagram context
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 25 Jan 2022 19:52:21 +0000 (20:52 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 27 Jan 2022 15:37:55 +0000 (16:37 +0100)
This quic_dgram_ctx struct member is used to denote if we are parsing a new
datagram (null value), or a coalesced packet into the current datagram (non null
value). But it was never set.

src/xprt_quic.c

index 588d8a24a2057f7667088c9827ece26ec20eac55..d021f62d10421b4f18c8d8929927e35fcc0364f7 100644 (file)
@@ -3988,6 +3988,7 @@ static ssize_t qc_srv_pkt_rcv(unsigned char **buf, const unsigned char *end,
         */
        if (!dgram_ctx->dcid.len) {
                memcpy(dgram_ctx->dcid.data, pkt->dcid.data, pkt->dcid.len);
+               dgram_ctx->dcid.len = pkt->dcid.len;
        }
        else if (memcmp(dgram_ctx->dcid.data, pkt->dcid.data, pkt->dcid.len)) {
                TRACE_PROTO("Packet dropped", QUIC_EV_CONN_SPKT, qc);
@@ -4601,6 +4602,7 @@ static ssize_t qc_lstnr_pkt_rcv(unsigned char *buf, const unsigned char *end,
         */
        if (!dgram_ctx->dcid.len) {
                memcpy(dgram_ctx->dcid.data, pkt->dcid.data, pkt->dcid.len);
+               dgram_ctx->dcid.len = pkt->dcid.len;
                if (!quic_peer_validated_addr(qc) &&
                    HA_ATOMIC_LOAD(&qc->flags) & QUIC_FL_CONN_ANTI_AMPLIFICATION_REACHED) {
                        TRACE_PROTO("PTO timer must be armed after anti-amplication was reached",