From: Amaury Denoyelle Date: Wed, 12 Nov 2025 10:36:09 +0000 (+0100) Subject: MINOR: quic: remove arg from qc_new_conn() X-Git-Tag: v3.3-dev14~48 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c67a614e45aefbeaaac852ceaddb486571104551;p=thirdparty%2Fhaproxy.git MINOR: quic: remove arg from qc_new_conn() Remove argument from qc_new_conn(). This parameter is unnecessary as it can be derived from the family type of the addresses also passed as argument. --- diff --git a/include/haproxy/quic_conn.h b/include/haproxy/quic_conn.h index 0c8c77c63..3c447c73d 100644 --- a/include/haproxy/quic_conn.h +++ b/include/haproxy/quic_conn.h @@ -64,7 +64,7 @@ struct task *quic_conn_app_io_cb(struct task *t, void *context, unsigned int sta void quic_conn_closed_err_count_inc(struct quic_conn *qc, struct quic_frame *frm); int qc_h3_request_reject(struct quic_conn *qc, uint64_t id); -struct quic_conn *qc_new_conn(void *target, int ipv4, +struct quic_conn *qc_new_conn(void *target, const struct quic_rx_packet *initial_pkt, const struct quic_cid *token_odcid, struct quic_connection_id *conn_id, diff --git a/src/quic_conn.c b/src/quic_conn.c index 9dc690d1c..7495cf823 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -1095,7 +1095,7 @@ struct task *qc_process_timer(struct task *task, void *ctx, unsigned int state) /* Allocate a new QUIC connection. represents the internal connection * endpoint, either a listener for a server-side connection or a server on - * client side. boolean is set to 1 for IPv4 connection or 0 for IPv6. + * client side. * * On server side, must points to the client INITIAL packet which * initiate this connection allocation. It is used as a source to determine the @@ -1113,7 +1113,7 @@ struct task *qc_process_timer(struct task *task, void *ctx, unsigned int state) * * Returns the newly allocated quic_conn instance on success or NULL on error. */ -struct quic_conn *qc_new_conn(void *target, int ipv4, +struct quic_conn *qc_new_conn(void *target, const struct quic_rx_packet *initial_pkt, const struct quic_cid *token_odcid, struct quic_connection_id *conn_id, @@ -1338,7 +1338,7 @@ struct quic_conn *qc_new_conn(void *target, int ipv4, qc->max_ack_delay = 0; /* Only one path at this time (multipath not supported) */ qc->path = &qc->paths[0]; - quic_cc_path_init(qc->path, ipv4, + quic_cc_path_init(qc->path, peer_addr->ss_family == AF_INET, l ? l->bind_conf->max_cwnd : quic_tune.be.cc_max_win_size, cc_algo ? cc_algo : default_quic_cc_algo, qc); diff --git a/src/quic_rx.c b/src/quic_rx.c index 6714c9037..f4e3f7d6b 100644 --- a/src/quic_rx.c +++ b/src/quic_rx.c @@ -1722,7 +1722,6 @@ static struct quic_conn *quic_rx_pkt_retrieve_conn(struct quic_rx_packet *pkt, if (!qc) { struct quic_connection_id *conn_id; - int ipv4; /* Reject INITIAL early if listener limits reached. */ if (unlikely(HA_ATOMIC_LOAD(&l->rx.quic_curr_handshake) >= @@ -1798,7 +1797,6 @@ static struct quic_conn *quic_rx_pkt_retrieve_conn(struct quic_rx_packet *pkt, } pkt->saddr = dgram->saddr; - ipv4 = dgram->saddr.ss_family == AF_INET; conn_id = quic_cid_alloc(); if (!conn_id) { @@ -1825,7 +1823,7 @@ static struct quic_conn *quic_rx_pkt_retrieve_conn(struct quic_rx_packet *pkt, pool_free(pool_head_quic_connection_id, conn_id); } else { - qc = qc_new_conn(l, ipv4, pkt, &token_odcid, + qc = qc_new_conn(l, pkt, &token_odcid, conn_id, &dgram->daddr, &pkt->saddr); if (qc == NULL) { quic_cid_delete(conn_id); /* Removes CID from global tree as it points to a NULL qc. */ diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 913fda803..ca7d4e9f9 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -136,7 +136,6 @@ static int qc_conn_init(struct connection *conn, void **xprt_ctx) } else { int retry_rand_cid = 3; /* Number of random retries on CID collision. */ - int ipv4 = conn->dst->ss_family == AF_INET; struct server *srv = objt_server(conn->target); conn_id = quic_cid_alloc(); @@ -162,7 +161,7 @@ static int qc_conn_init(struct connection *conn, void **xprt_ctx) goto out; } - qc = qc_new_conn(srv, ipv4, NULL, NULL, conn_id, NULL, &srv->addr); + qc = qc_new_conn(srv, NULL, NULL, conn_id, NULL, &srv->addr); if (!qc) { pool_free(pool_head_quic_connection_id, conn_id); goto out;