diff --git a/include/haproxy/quic_conn-t.h b/include/haproxy/quic_conn-t.h index 01a98700e..05b48f890 100644 --- a/include/haproxy/quic_conn-t.h +++ b/include/haproxy/quic_conn-t.h @@ -440,10 +440,6 @@ struct quic_conn_cntrs { /* Idle timer task */ \ struct task *idle_timer_task; \ unsigned int idle_expire; \ - struct ssl_sock_ctx *xprt_ctx; \ - /* Used only to reach the tasklet for the I/O handler from this \ - * quic_conn object. \ - */ \ /* QUIC connection level counters */ \ struct quic_conn_cntrs cntrs; \ struct connection *conn; \ @@ -451,6 +447,10 @@ struct quic_conn_cntrs { struct quic_conn { QUIC_CONN_COMMON; + /* Used only to reach the tasklet for the I/O handler from this + * quic_conn object. + */ + struct ssl_sock_ctx *xprt_ctx; const struct quic_version *original_version; const struct quic_version *negotiated_version; /* Negotiated version Initial TLS context */ diff --git a/src/quic_conn.c b/src/quic_conn.c index 7515e8d00..d5d5adeaf 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -770,7 +770,6 @@ static void quic_release_cc_conn(struct quic_cc_conn *cc_qc) pool_free(pool_head_quic_cc_buf, cc_qc->cc_buf_area); cc_qc->cc_buf_area = NULL; /* free the SSL sock context */ - qc_free_ssl_sock_ctx(&cc_qc->xprt_ctx); pool_free(pool_head_quic_cc_conn, cc_qc); TRACE_ENTER(QUIC_EV_CONN_IO_CB); @@ -878,8 +877,6 @@ static struct quic_cc_conn *qc_new_cc_conn(struct quic_conn *qc) cc_qc->idle_timer_task->context = cc_qc; cc_qc->idle_expire = qc->idle_expire; - cc_qc->xprt_ctx = qc->xprt_ctx; - qc->xprt_ctx = NULL; cc_qc->conn = qc->conn; qc->conn = NULL; @@ -1472,8 +1469,6 @@ void quic_conn_release(struct quic_conn *qc) qc->cids = NULL; pool_free(pool_head_quic_cc_buf, qc->tx.cc_buf_area); qc->tx.cc_buf_area = NULL; - /* free the SSL sock context */ - qc_free_ssl_sock_ctx(&qc->xprt_ctx); } /* in the unlikely (but possible) case the connection was just added to @@ -1496,6 +1491,8 @@ void quic_conn_release(struct quic_conn *qc) qc_stream_desc_free(stream, 1); } + /* free the SSL sock context */ + qc_free_ssl_sock_ctx(&qc->xprt_ctx); /* Purge Rx packet list. */ list_for_each_entry_safe(pkt, pktback, &qc->rx.pkt_list, qc_rx_pkt_list) { LIST_DELETE(&pkt->qc_rx_pkt_list);