QLOG: Wiring: QUIC QRX: Report the datagram ID from the DEMUX
authorHugo Landau <hlandau@openssl.org>
Fri, 8 Sep 2023 10:02:32 +0000 (11:02 +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_record_rx.h
ssl/quic/quic_record_rx.c

index 24c2bbc8aec5498062f0664cf0852ada2e875adc..92ab77eaac7907dcae0c4b36aef9cf0140c1bd7f 100644 (file)
@@ -225,6 +225,12 @@ struct ossl_qrx_pkt_st {
      * packets.
      */
     uint64_t            key_epoch;
+
+    /*
+     * This monotonically increases with each datagram received.
+     * It is for diagnostic use only.
+     */
+    uint64_t            datagram_id;
 };
 
 /*
index 97dadd3dbe3419313b956435365bba08b9de0eae..ef05997d0d54dde474d3053ed1cfe0c5c25a605d 100644 (file)
@@ -67,6 +67,12 @@ struct rxe_st {
      */
     uint64_t            key_epoch;
 
+    /*
+     * Monotonically increases with each datagram received.
+     * For diagnostic use only.
+     */
+    uint64_t            datagram_id;
+
     /*
      * alloc_len allocated bytes (of which data_len bytes are valid) follow this
      * structure.
@@ -865,6 +871,7 @@ static int qrx_process_pkt(OSSL_QRX *qrx, QUIC_URXE *urxe,
         rxe->peer           = urxe->peer;
         rxe->local          = urxe->local;
         rxe->time           = urxe->time;
+        rxe->datagram_id    = urxe->datagram_id;
 
         /* Move RXE to pending. */
         ossl_list_rxe_remove(&qrx->rx_free, rxe);
@@ -1046,9 +1053,10 @@ static int qrx_process_pkt(OSSL_QRX *qrx, QUIC_URXE *urxe,
         qrx->largest_pn[pn_space] = rxe->pn;
 
     /* Copy across network addresses and RX time from URXE to RXE. */
-    rxe->peer   = urxe->peer;
-    rxe->local  = urxe->local;
-    rxe->time   = urxe->time;
+    rxe->peer           = urxe->peer;
+    rxe->local          = urxe->local;
+    rxe->time           = urxe->time;
+    rxe->datagram_id    = urxe->datagram_id;
 
     /* Move RXE to pending. */
     ossl_list_rxe_remove(&qrx->rx_free, rxe);
@@ -1227,6 +1235,7 @@ int ossl_qrx_read_pkt(OSSL_QRX *qrx, OSSL_QRX_PKT **ppkt)
     rxe->pkt.local
         = BIO_ADDR_family(&rxe->local) != AF_UNSPEC ? &rxe->local : NULL;
     rxe->pkt.key_epoch      = rxe->key_epoch;
+    rxe->pkt.datagram_id    = rxe->datagram_id;
     rxe->pkt.qrx            = qrx;
     *ppkt = &rxe->pkt;