From: Frédéric Lécaille Date: Tue, 25 Jan 2022 19:52:21 +0000 (+0100) Subject: MINOR: quic: No DCID length for datagram context X-Git-Tag: v2.6-dev1~63 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4852101fd2f351b9594041bbf445b773beb60f56;p=thirdparty%2Fhaproxy.git MINOR: quic: No DCID length for datagram context 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. --- diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 588d8a24a2..d021f62d10 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -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",