MINOR: quic: remove connection arg from qc_new_conn()

This patch is similar to the previous one, this time dealing with
qc_new_conn(). This function was asymetric on frontend and backend side,
as connection argument was set only in the latter case.

This was required prior due to qc_alloc_ssl_sock_ctx() signature. This
has changed with the previous patch, thus qc_new_conn() can also be
realigned on both FE and BE sides. <conn> member of quic_conn instance
is always set outside it, in qc_xprt_start() on the backend case.
This commit is contained in:
Amaury Denoyelle 2025-11-04 17:47:42 +01:00
parent 5a17cade4f
commit efe60745b3
4 changed files with 8 additions and 10 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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)