From: Hugo Landau Date: Fri, 8 Sep 2023 10:01:35 +0000 (+0100) Subject: QLOG: Wiring: QUIC DEMUX: Report a monotonically increasing datagram ID X-Git-Tag: openssl-3.3.0-alpha1~222 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=266a827d816c204d85ef04ce5d028a61d8e2b187;p=thirdparty%2Fopenssl.git QLOG: Wiring: QUIC DEMUX: Report a monotonically increasing datagram ID Reviewed-by: Matt Caswell Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/22037) --- diff --git a/include/internal/quic_demux.h b/include/internal/quic_demux.h index bc0ad956360..158c2ecff31 100644 --- a/include/internal/quic_demux.h +++ b/include/internal/quic_demux.h @@ -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 diff --git a/ssl/quic/quic_demux.c b/ssl/quic/quic_demux.c index b3e03a0bcab..5677c1e0d56 100644 --- a/ssl/quic/quic_demux.c +++ b/ssl/quic/quic_demux.c @@ -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);