From 3e16784dfc35b1c9a7e1a4c125a0e1aac2efb80f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Tue, 28 Nov 2023 14:52:22 +0100 Subject: [PATCH] REORG: quic: Remove qc_pkt_insert() implementation As this function does only a few things with a not very well chosen name, remove it and replace it by the its statements at the unique location it is called. --- src/quic_rx.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/quic_rx.c b/src/quic_rx.c index 94593a622e..828dfbeaac 100644 --- a/src/quic_rx.c +++ b/src/quic_rx.c @@ -1412,19 +1412,6 @@ static inline int quic_packet_read_long_header(unsigned char **pos, const unsign return ret; } -/* Insert RX packet in its RX packets tree */ -static void qc_pkt_insert(struct quic_conn *qc, - struct quic_rx_packet *pkt, struct quic_enc_level *qel) -{ - TRACE_ENTER(QUIC_EV_CONN_RXPKT, qc); - - pkt->pn_node.key = pkt->pn; - quic_rx_packet_refinc(pkt); - eb64_insert(&qel->rx.pkts, &pkt->pn_node); - - TRACE_LEAVE(QUIC_EV_CONN_RXPKT, qc); -} - /* Try to remove the header protection of QUIC packet with the * address of the packet first byte, using the keys from encryption level . * @@ -2128,8 +2115,12 @@ static void qc_rx_pkt_handle(struct quic_conn *qc, struct quic_rx_packet *pkt, } TRACE_DATA("New packet", QUIC_EV_CONN_LPKT, qc, pkt, NULL, qv); - if (pkt->aad_len) - qc_pkt_insert(qc, pkt, qel); + if (pkt->aad_len) { + /* Insert this RX packet in its encryption level tree */ + pkt->pn_node.key = pkt->pn; + quic_rx_packet_refinc(pkt); + eb64_insert(&qel->rx.pkts, &pkt->pn_node); + } out: *tasklist_head = tasklet_wakeup_after(*tasklist_head, qc->wait_event.tasklet); -- 2.47.3