From: Hugo Landau Date: Fri, 8 Sep 2023 10:02:32 +0000 (+0100) Subject: QLOG: Wiring: QUIC QRX: Report the datagram ID from the DEMUX X-Git-Tag: openssl-3.3.0-alpha1~221 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=285a76bda02192818cedc2a7db8ff54bbd6a3586;p=thirdparty%2Fopenssl.git QLOG: Wiring: QUIC QRX: Report the datagram ID from the DEMUX Reviewed-by: Matt Caswell Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/22037) --- diff --git a/include/internal/quic_record_rx.h b/include/internal/quic_record_rx.h index 24c2bbc8aec..92ab77eaac7 100644 --- a/include/internal/quic_record_rx.h +++ b/include/internal/quic_record_rx.h @@ -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; }; /* diff --git a/ssl/quic/quic_record_rx.c b/ssl/quic/quic_record_rx.c index 97dadd3dbe3..ef05997d0d5 100644 --- a/ssl/quic/quic_record_rx.c +++ b/ssl/quic/quic_record_rx.c @@ -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;