From: Hugo Landau Date: Tue, 6 Jun 2023 15:25:10 +0000 (+0100) Subject: QUIC ACKM: Clarify the role of is_inflight X-Git-Tag: openssl-3.2.0-alpha1~451 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=85bbef270c1d15ec34e152c13f41ec0c298f5459;p=thirdparty%2Fopenssl.git QUIC ACKM: Clarify the role of is_inflight Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/21135) --- diff --git a/include/internal/quic_ackm.h b/include/internal/quic_ackm.h index 7574c97a964..ca0c1aab1f0 100644 --- a/include/internal/quic_ackm.h +++ b/include/internal/quic_ackm.h @@ -67,10 +67,19 @@ struct ossl_ackm_tx_pkt_st { */ unsigned int pkt_space :2; - /* 1 if the packet is in flight. */ + /* + * 1 if the packet is in flight. A packet is considered 'in flight' if it is + * counted for purposes of congestion control and 'bytes in flight' counts. + * Most packets are considered in flight. The only circumstance where a + * numbered packet is not considered in flight is if it contains only ACK + * frames (not even PADDING frames), as these frames can bypass CC. + */ unsigned int is_inflight :1; - /* 1 if the packet has one or more ACK-eliciting frames. */ + /* + * 1 if the packet has one or more ACK-eliciting frames. + * Note that if this is set, is_inflight must be set. + */ unsigned int is_ack_eliciting :1; /* 1 if the packet is a PTO probe. */ diff --git a/ssl/quic/quic_ackm.c b/ssl/quic/quic_ackm.c index 777d71ce53a..a6c8ebef1fc 100644 --- a/ssl/quic/quic_ackm.c +++ b/ssl/quic/quic_ackm.c @@ -1068,6 +1068,10 @@ int ossl_ackm_on_tx_packet(OSSL_ACKM *ackm, OSSL_ACKM_TX_PKT *pkt) if (pkt->num_bytes == 0) return 0; + /* Does not make any sense for a non-in-flight packet to be ACK-eliciting. */ + if (!pkt->is_inflight && pkt->is_ack_eliciting) + return 0; + if (tx_pkt_history_add(h, pkt) == 0) return 0;