]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC ACKM: Don't record non-inflight packets in CC
authorHugo Landau <hlandau@openssl.org>
Mon, 3 Jul 2023 14:45:25 +0000 (15:45 +0100)
committerPauli <pauli@openssl.org>
Wed, 19 Jul 2023 03:03:11 +0000 (13:03 +1000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21349)

ssl/quic/quic_ackm.c

index facd34176a0552a2c15c338435fc52258fec9707..3e05b5f833586b4b2d10b6ca4fe1edbd1b429fff 100644 (file)
@@ -951,18 +951,18 @@ static void ackm_on_pkts_lost(OSSL_ACKM *ackm, int pkt_space,
 
             if (p->pkt_num > largest_pn_lost)
                 largest_pn_lost = p->pkt_num;
-        }
 
-        if (!pseudo) {
-            /*
-             * If this is pseudo-loss (e.g. during connection retry) we do not
-             * inform the CC as it is not a real loss and not reflective of
-             * network conditions.
-             */
-            loss_info.tx_time = p->time;
-            loss_info.tx_size = p->num_bytes;
+            if (!pseudo) {
+                /*
+                 * If this is pseudo-loss (e.g. during connection retry) we do not
+                 * inform the CC as it is not a real loss and not reflective of
+                 * network conditions.
+                 */
+                loss_info.tx_time = p->time;
+                loss_info.tx_size = p->num_bytes;
 
-            ackm->cc_method->on_data_lost(ackm->cc_data, &loss_info);
+                ackm->cc_method->on_data_lost(ackm->cc_data, &loss_info);
+            }
         }
 
         p->on_lost(p->cb_arg);
@@ -1012,7 +1012,8 @@ static void ackm_on_pkts_acked(OSSL_ACKM *ackm, const OSSL_ACKM_TX_PKT *apkt)
         anext = apkt->anext;
         apkt->on_acked(apkt->cb_arg); /* may free apkt */
 
-        ackm->cc_method->on_data_acked(ackm->cc_data, &ainfo);
+        if (apkt->is_inflight)
+            ackm->cc_method->on_data_acked(ackm->cc_data, &ainfo);
     }
 }