]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC CC: Minor fixes
authorHugo Landau <hlandau@openssl.org>
Thu, 2 Mar 2023 16:05:36 +0000 (16:05 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 1 May 2023 10:03:54 +0000 (11:03 +0100)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20423)

ssl/quic/quic_ackm.c
test/quic_cc_test.c

index b79863657199f9bd6f3a661a7ce9cba67df3146e..f7986728f6c9ed4fef819f5f690361375d46c69c 100644 (file)
@@ -921,7 +921,6 @@ static void ackm_on_pkts_lost(OSSL_ACKM *ackm, int pkt_space,
     const OSSL_ACKM_TX_PKT *p, *pnext;
     OSSL_RTT_INFO rtt;
     QUIC_PN largest_pn_lost = 0;
-    uint64_t num_bytes = 0;
     OSSL_CC_LOSS_INFO loss_info = {0};
     uint32_t flags = 0;
 
@@ -936,8 +935,6 @@ 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;
-
-            num_bytes += p->num_bytes;
         }
 
         if (!pseudo) {
index e3e5e87d3836ef7226f47244e14268bab1143f6d..3eef4d64a206c07989cedbb7d3f0e504773dbb78 100644 (file)
@@ -371,6 +371,8 @@ static int test_simulate(void)
 
             allowance = ccm->get_tx_allowance(cc);
             sz = allowance > mdpl ? mdpl : allowance;
+            if (sz > SIZE_MAX)
+                sz = SIZE_MAX;
 
             /*
              * QUIC minimum packet sizes, etc. mean that in practice we will not
@@ -381,7 +383,7 @@ static int test_simulate(void)
 
             step_time(7);
 
-            if (!TEST_true(net_sim_send(&sim, sz)))
+            if (!TEST_true(net_sim_send(&sim, (size_t)sz)))
                 goto err;
 
             total_sent += sz;