diff --git a/include/haproxy/quic_conn.h b/include/haproxy/quic_conn.h index db32934ef..b48b53f87 100644 --- a/include/haproxy/quic_conn.h +++ b/include/haproxy/quic_conn.h @@ -70,8 +70,7 @@ struct quic_conn *qc_new_conn(const struct quic_version *qv, int ipv4, struct quic_connection_id *conn_id, struct sockaddr_storage *local_addr, struct sockaddr_storage *peer_addr, - int token, void *owner, - struct connection *conn); + int token, void *owner); int quic_build_post_handshake_frames(struct quic_conn *qc); const struct quic_version *qc_supported_version(uint32_t version); int quic_peer_validated_addr(struct quic_conn *qc); diff --git a/src/quic_conn.c b/src/quic_conn.c index 98a9820b2..e6d59cfe8 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -1079,8 +1079,7 @@ struct quic_conn *qc_new_conn(const struct quic_version *qv, int ipv4, struct quic_connection_id *conn_id, struct sockaddr_storage *local_addr, struct sockaddr_storage *peer_addr, - int token, void *target, - struct connection *conn) + int token, void *target) { struct quic_conn *qc = NULL; struct listener *l = objt_listener(target); @@ -1151,7 +1150,6 @@ struct quic_conn *qc_new_conn(const struct quic_version *qv, int ipv4, qc->idle_timer_task = NULL; qc->xprt_ctx = NULL; - /* We must not free the quic-conn if upper conn is still allocated. */ qc->conn = NULL; qc->qcc = NULL; qc->app_ops = NULL; @@ -1228,7 +1226,6 @@ struct quic_conn *qc_new_conn(const struct quic_version *qv, int ipv4, conn_id = conn_cid; qc->next_cid_seq_num = 1; - conn->handle.qc = qc; } qc->mux_state = QC_MUX_NULL; qc->err = quic_err_transport(QC_ERR_NO_ERROR); @@ -1367,7 +1364,6 @@ struct quic_conn *qc_new_conn(const struct quic_version *qv, int ipv4, if (!qc_new_isecs(qc, &qc->iel->tls_ctx, qc->original_version, dcid->data, dcid->len, !!l)) goto err; - qc->conn = conn; /* Counters initialization */ memset(&qc->cntrs, 0, sizeof qc->cntrs); diff --git a/src/quic_rx.c b/src/quic_rx.c index 56078b6ce..ee31d54a4 100644 --- a/src/quic_rx.c +++ b/src/quic_rx.c @@ -1746,7 +1746,7 @@ static struct quic_conn *quic_rx_pkt_retrieve_conn(struct quic_rx_packet *pkt, qc = qc_new_conn(pkt->version, ipv4, &pkt->dcid, &pkt->scid, &token_odcid, conn_id, &dgram->daddr, &pkt->saddr, - !!pkt->token_len, l, NULL); + !!pkt->token_len, l); if (qc == NULL) { pool_free(pool_head_quic_connection_id, conn_id); goto err; diff --git a/src/xprt_quic.c b/src/xprt_quic.c index dbcbb4caf..12b838c03 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -124,9 +124,12 @@ static int qc_conn_init(struct connection *conn, void **xprt_ctx) int ipv4 = conn->dst->ss_family == AF_INET; struct server *srv = objt_server(conn->target); qc = qc_new_conn(quic_version_1, ipv4, NULL, NULL, NULL, - NULL, NULL, &srv->addr, 0, srv, conn); - if (qc) + NULL, NULL, &srv->addr, 0, srv); + if (qc) { conn->flags |= CO_FL_SSL_WAIT_HS | CO_FL_WAIT_L6_CONN; + conn->handle.qc = qc; + qc->conn = conn; + } } if (!qc)