QLOG: Wiring: QUIC DEMUX: Report a monotonically increasing datagram ID
authorHugo Landau <hlandau@openssl.org>
Fri, 8 Sep 2023 10:01:35 +0000 (11:01 +0100)
committerHugo Landau <hlandau@openssl.org>
Fri, 2 Feb 2024 11:49:34 +0000 (11:49 +0000)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22037)

include/internal/quic_demux.h
ssl/quic/quic_demux.c

index bc0ad9563600b7834f31b67323ced653e3ece06a..158c2ecff31a080928eec60b7c99b89f3c353ac8 100644 (file)
@@ -106,6 +106,12 @@ struct quic_urxe_st {
      */
     uint64_t        processed, hpr_removed;
 
+    /*
+     * This monotonically increases with each datagram received. It is used for
+     * diagnostic purposes only.
+     */
+    uint64_t        datagram_id;
+
     /*
      * Address of peer we received the datagram from, and the local interface
      * address we received it on. If local address support is not enabled, local
index b3e03a0bcab6ee03c17e8cdc0e399191ed263b9d..5677c1e0d56311f5e9757cf7e16c011a84bd10f6 100644 (file)
@@ -38,6 +38,9 @@ struct quic_demux_st {
      */
     size_t                      mtu;
 
+    /* The datagram_id to use for the next datagram we receive. */
+    uint64_t                    next_datagram_id;
+
     /* Time retrieval callback. */
     OSSL_TIME                 (*now)(void *arg);
     void                       *now_arg;
@@ -300,6 +303,7 @@ static int demux_recv(QUIC_DEMUX *demux)
         urxe->data_len      = msg[i].data_len;
         /* Time we received datagram. */
         urxe->time          = now;
+        urxe->datagram_id   = demux->next_datagram_id++;
         /* Move from free list to pending list. */
         ossl_list_urxe_remove(&demux->urx_free, urxe);
         ossl_list_urxe_insert_tail(&demux->urx_pending, urxe);