From: Hugo Landau Date: Thu, 9 Nov 2023 10:27:14 +0000 (+0000) Subject: QUIC QRX: Remove legacy DEMUX-QRX routing code X-Git-Tag: openssl-3.3.0-alpha1~420 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef95d8ddcaaa95ef4f2a072767fffcc1ca0f095e;p=thirdparty%2Fopenssl.git QUIC QRX: Remove legacy DEMUX-QRX routing code Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/22674) --- diff --git a/include/internal/quic_record_rx.h b/include/internal/quic_record_rx.h index c4ed5a71d38..cc2d6e94d8f 100644 --- a/include/internal/quic_record_rx.h +++ b/include/internal/quic_record_rx.h @@ -28,7 +28,7 @@ typedef struct ossl_qrx_args_st { OSSL_LIB_CTX *libctx; const char *propq; - /* Demux to receive datagrams from. */ + /* Demux which owns the URXEs passed to us. */ QUIC_DEMUX *demux; /* Length of connection IDs used in short-header packets in bytes. */ @@ -66,40 +66,6 @@ void ossl_qrx_set_msg_callback(OSSL_QRX *qrx, ossl_msg_cb msg_callback, void ossl_qrx_set_msg_callback_arg(OSSL_QRX *qrx, void *msg_callback_arg); -/* - * DCID Management - * =============== - */ - -/* - * Adds a given DCID to the QRX. The QRX will register the DCID with the demuxer - * so that incoming packets with that DCID are passed to the given QRX. Multiple - * DCIDs may be associated with a QRX at any one time. You will need to add at - * least one DCID after instantiating the QRX. A zero-length DCID is a valid - * input to this function. This function fails if the DCID is already - * registered. - * - * TODO(QUIC SERVER): DEPRECATED in favour of explicit routing by QUIC_PORT with - * reference to QUIC_LCIDM. To be removed. - * - * Returns 1 on success or 0 on error. - */ -int ossl_qrx_add_dst_conn_id(OSSL_QRX *qrx, - const QUIC_CONN_ID *dst_conn_id); - -/* - * Remove a DCID previously registered with ossl_qrx_add_dst_conn_id. The DCID - * is unregistered from the demuxer. Fails if the DCID is not registered with - * the demuxer. - * - * TODO(QUIC SERVER): DEPRECATED in favour of explicit routing by QUIC_PORT with - * reference to QUIC_LCIDM. To be removed. - * - * Returns 1 on success or 0 on error. - */ -int ossl_qrx_remove_dst_conn_id(OSSL_QRX *qrx, - const QUIC_CONN_ID *dst_conn_id); - /* * Secret Management * ================= diff --git a/ssl/quic/quic_record_rx.c b/ssl/quic/quic_record_rx.c index d35264e7a27..393007df50f 100644 --- a/ssl/quic/quic_record_rx.c +++ b/ssl/quic/quic_record_rx.c @@ -167,8 +167,6 @@ struct ossl_qrx_st { SSL *msg_callback_ssl; }; -static void qrx_on_rx(QUIC_URXE *urxe, void *arg, const QUIC_CONN_ID *dcid); - OSSL_QRX *ossl_qrx_new(const OSSL_QRX_ARGS *args) { OSSL_QRX *qrx; @@ -222,9 +220,6 @@ void ossl_qrx_free(OSSL_QRX *qrx) if (qrx == NULL) return; - /* Unregister from the RX DEMUX. */ - ossl_quic_demux_unregister_by_cb(qrx->demux, qrx_on_rx, qrx); - /* Free RXE queue data. */ qrx_cleanup_rxl(&qrx->rx_free); qrx_cleanup_rxl(&qrx->rx_pending); @@ -252,28 +247,6 @@ void ossl_qrx_inject_urxe(OSSL_QRX *qrx, QUIC_URXE *urxe) qrx->msg_callback_arg); } -static void qrx_on_rx(QUIC_URXE *urxe, void *arg, const QUIC_CONN_ID *dcid) -{ - OSSL_QRX *qrx = arg; - - ossl_qrx_inject_urxe(qrx, urxe); -} - -int ossl_qrx_add_dst_conn_id(OSSL_QRX *qrx, - const QUIC_CONN_ID *dst_conn_id) -{ - return ossl_quic_demux_register(qrx->demux, - dst_conn_id, - qrx_on_rx, - qrx); -} - -int ossl_qrx_remove_dst_conn_id(OSSL_QRX *qrx, - const QUIC_CONN_ID *dst_conn_id) -{ - return ossl_quic_demux_unregister(qrx->demux, dst_conn_id); -} - static void qrx_requeue_deferred(OSSL_QRX *qrx) { QUIC_URXE *e;