diff --git a/src/quic_tx.c b/src/quic_tx.c index d457bf310..dd6f7f714 100644 --- a/src/quic_tx.c +++ b/src/quic_tx.c @@ -698,7 +698,7 @@ static int qc_prep_pkts(struct quic_conn *qc, struct buffer *buf, */ if (qel == qc->iel && (qc_is_back(qc) || !LIST_ISEMPTY(frms) || probe)) { /* Ensure that no Initial packets are sent into too small datagrams */ - if (end - pos < QUIC_INITIAL_PACKET_MINLEN) { + if (end - pos + dglen < QUIC_INITIAL_PACKET_MINLEN) { TRACE_PROTO("No more enough room to build an Initial packet", QUIC_EV_CONN_PHPKTS, qc); break;