MINOR: quic: remove <ipv4> arg from qc_new_conn()

Remove <ipv4> 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.
This commit is contained in:
Amaury Denoyelle 2025-11-12 11:36:09 +01:00
parent 133f100467
commit c67a614e45
4 changed files with 6 additions and 9 deletions

View File

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

View File

@ -1095,7 +1095,7 @@ struct task *qc_process_timer(struct task *task, void *ctx, unsigned int state)
/* Allocate a new QUIC connection. <target> represents the internal connection
* endpoint, either a listener for a server-side connection or a server on
* client side. <ipv4> boolean is set to 1 for IPv4 connection or 0 for IPv6.
* client side.
*
* On server side, <initial_pkt> 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);

View File

@ -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. */

View File

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