From 4852101fd2f351b9594041bbf445b773beb60f56 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Tue, 25 Jan 2022 20:52:21 +0100 Subject: [PATCH] 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. --- src/xprt_quic.c | 2 ++ 1 file changed, 2 insertions(+) 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", -- 2.47.3