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.
This commit is contained in:
Frédéric Lécaille 2022-01-25 20:52:21 +01:00 committed by Amaury Denoyelle
parent 97ea9c49f1
commit 4852101fd2

View 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",