]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC Probes Support: Minor tweaks
authorHugo Landau <hlandau@openssl.org>
Thu, 26 Jan 2023 13:30:38 +0000 (13:30 +0000)
committerTomas Mraz <tomas@openssl.org>
Mon, 30 Jan 2023 08:44:59 +0000 (09:44 +0100)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19925)

include/internal/quic_ackm.h
ssl/quic/quic_ackm.c
ssl/quic/quic_txp.c
test/quic_ackm_test.c
test/quic_txp_test.c

index 4bdf15ff1e28e7743fadb4a738abfbea951a2bf3..1fedc087699e73ebe035b7ff2307e09a379362dd 100644 (file)
@@ -232,7 +232,7 @@ typedef struct ossl_ackm_probe_info_st {
  * have been generated by the ACKM. The fields in the structure are incremented
  * by one every time the ACKM wants another probe of the given type to be sent.
  * If the ACKM thinks two packets should be generated for a probe, it will
- * increment the field twice (TODO).
+ * increment the field twice.
  *
  * It is permissible for the caller to decrement or zero these fields to keep
  * track of when it has generated a probe as asked. The returned structure
@@ -241,7 +241,7 @@ typedef struct ossl_ackm_probe_info_st {
  * This function should be called after calling e.g. ossl_ackm_on_timeout
  * to determine if any probe requests have been generated.
  */
-OSSL_ACKM_PROBE_INFO *ossl_ackm_get_probe_request(OSSL_ACKM *ackm);
+OSSL_ACKM_PROBE_INFO *ossl_ackm_get0_probe_request(OSSL_ACKM *ackm);
 
 int ossl_ackm_get_largest_unacked(OSSL_ACKM *ackm, int pkt_space, QUIC_PN *pn);
 
index 7e692a27ee2fc7d7ada981f2f8d23ba6051ae44d..6061fb29f59c0920c4086817b93dc89a5d7305e8 100644 (file)
@@ -1316,7 +1316,7 @@ OSSL_TIME ossl_ackm_get_loss_detection_deadline(OSSL_ACKM *ackm)
     return ackm->loss_detection_deadline;
 }
 
-OSSL_ACKM_PROBE_INFO *ossl_ackm_get_probe_request(OSSL_ACKM *ackm)
+OSSL_ACKM_PROBE_INFO *ossl_ackm_get0_probe_request(OSSL_ACKM *ackm)
 {
     return &ackm->pending_probe;
 }
index 5be9c2b7f8739a482fb2f76d1524c0b240a8c079..0f3383875c6a63fb52fe6eb05544fb5e754bb9fb 100644 (file)
@@ -766,7 +766,7 @@ static int txp_el_pending(OSSL_QUIC_TX_PACKETISER *txp, uint32_t enc_level,
     /* Do we need to send a PTO probe? */
     if (a.allow_force_ack_eliciting) {
         OSSL_ACKM_PROBE_INFO *probe_info
-            = ossl_ackm_get_probe_request(txp->args.ackm);
+            = ossl_ackm_get0_probe_request(txp->args.ackm);
 
         if ((enc_level == QUIC_ENC_LEVEL_INITIAL
              && probe_info->anti_deadlock_initial > 0)
@@ -1823,7 +1823,7 @@ static int txp_generate_for_el_actual(OSSL_QUIC_TX_PACKETISER *txp,
     OSSL_QTX_PKT pkt;
     QUIC_STREAM *tmp_head = NULL, *stream;
     OSSL_ACKM_PROBE_INFO *probe_info
-        = ossl_ackm_get_probe_request(txp->args.ackm);
+        = ossl_ackm_get0_probe_request(txp->args.ackm);
 
     if (!txp_get_archetype_data(enc_level, archetype, &a))
         goto fatal_err;
index aee9f1c40ae033581fb19cb1d122b0b2eab0248c..a743ecb5eeaee10804c90a4875929ac96e805f64 100644 (file)
@@ -425,7 +425,7 @@ static int test_tx_ack_case_actual(int tidx, int space, int mode)
             goto err;
 
         /* Should not have any probe requests yet. */
-        probe = *ossl_ackm_get_probe_request(h.ackm);
+        probe = *ossl_ackm_get0_probe_request(h.ackm);
         if (!TEST_int_eq(test_probe_counts(&probe, 0, 0, 0, 0, 0), 1))
             goto err;
 
@@ -445,9 +445,9 @@ static int test_tx_ack_case_actual(int tidx, int space, int mode)
 
         /* Should have a probe request. Not cleared by first call. */
         for (i = 0; i < 3; ++i) {
-            probe = *ossl_ackm_get_probe_request(h.ackm);
+            probe = *ossl_ackm_get0_probe_request(h.ackm);
             if (i > 0)
-                memset(ossl_ackm_get_probe_request(h.ackm), 0, sizeof(probe));
+                memset(ossl_ackm_get0_probe_request(h.ackm), 0, sizeof(probe));
 
             if (i == 2) {
                 if (!TEST_int_eq(test_probe_counts(&probe, 0, 0, 0, 0, 0), 1))
index 8d0b7ea3590cffa8bcb3069e6edcda3d9fda6b02..edc7b25e9a9bb556f81c528213d39614be907091 100644 (file)
@@ -1089,7 +1089,7 @@ static const struct script_op script_14[] = {
 /* 15. INITIAL, Anti-Deadlock Probe Simulation */
 static int gen_probe_initial(struct helper *h)
 {
-    OSSL_ACKM_PROBE_INFO *probe = ossl_ackm_get_probe_request(h->args.ackm);
+    OSSL_ACKM_PROBE_INFO *probe = ossl_ackm_get0_probe_request(h->args.ackm);
 
     /*
      * Pretend the ACKM asked for an anti-deadlock Initial probe.
@@ -1117,7 +1117,7 @@ static const struct script_op script_15[] = {
 /* 16. HANDSHAKE, Anti-Deadlock Probe Simulation */
 static int gen_probe_handshake(struct helper *h)
 {
-    OSSL_ACKM_PROBE_INFO *probe = ossl_ackm_get_probe_request(h->args.ackm);
+    OSSL_ACKM_PROBE_INFO *probe = ossl_ackm_get0_probe_request(h->args.ackm);
 
     /*
      * Pretend the ACKM asked for an anti-deadlock Handshake probe.
@@ -1146,7 +1146,7 @@ static const struct script_op script_16[] = {
 /* 17. 1-RTT, Probe Simulation */
 static int gen_probe_1rtt(struct helper *h)
 {
-    OSSL_ACKM_PROBE_INFO *probe = ossl_ackm_get_probe_request(h->args.ackm);
+    OSSL_ACKM_PROBE_INFO *probe = ossl_ackm_get0_probe_request(h->args.ackm);
 
     /*
      * Pretend the ACKM asked for a 1-RTT PTO probe.