From: Frédéric Lécaille Date: Mon, 27 Nov 2023 16:28:40 +0000 (+0100) Subject: REORG: quic: Move qc_may_probe_ipktns() to quic_tls.h X-Git-Tag: v2.9-dev12~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0b872e24cda0b2b5907bc88ce8920350f5ad1ff6;p=thirdparty%2Fhaproxy.git REORG: quic: Move qc_may_probe_ipktns() to quic_tls.h This function is in relation with the Initial packet number space which is more linked to the QUIC TLS specifications. Let's move it to quic_tls.h to be inlined. --- diff --git a/include/haproxy/quic_tls.h b/include/haproxy/quic_tls.h index 473545fefe..86b8c1ee32 100644 --- a/include/haproxy/quic_tls.h +++ b/include/haproxy/quic_tls.h @@ -1099,6 +1099,17 @@ static inline int qc_need_sending(struct quic_conn *qc, struct quic_enc_level *q !LIST_ISEMPTY(&qel->pktns->tx.frms); } +/* Return 1 if connection may probe the Initial packet number space, 0 if not. + * This is not the case if the remote peer address is not validated and if + * it cannot send at least QUIC_INITIAL_PACKET_MINLEN bytes. + */ +static inline int qc_may_probe_ipktns(struct quic_conn *qc) +{ + return quic_peer_validated_addr(qc) || + quic_may_send_bytes(qc) >= QUIC_INITIAL_PACKET_MINLEN; +} + + #endif /* USE_QUIC */ #endif /* _PROTO_QUIC_TLS_H */ diff --git a/include/haproxy/quic_tx.h b/include/haproxy/quic_tx.h index 8ec5d83bc4..b81fa776ef 100644 --- a/include/haproxy/quic_tx.h +++ b/include/haproxy/quic_tx.h @@ -35,7 +35,6 @@ struct buffer *qc_get_txb(struct quic_conn *qc); int qc_prep_hpkts(struct quic_conn *qc, struct buffer *buf, struct list *qels); int qc_send_ppkts(struct buffer *buf, struct ssl_sock_ctx *ctx); -int qc_may_probe_ipktns(struct quic_conn *qc); int qc_send_app_pkts(struct quic_conn *qc, struct list *frms); int qc_dgrams_retransmit(struct quic_conn *qc); int qc_notify_send(struct quic_conn *qc); diff --git a/src/quic_tx.c b/src/quic_tx.c index 5ac05713bc..57a0934459 100644 --- a/src/quic_tx.c +++ b/src/quic_tx.c @@ -1337,16 +1337,6 @@ int qc_dgrams_retransmit(struct quic_conn *qc) return ret; } -/* Return 1 if connection may probe the Initial packet number space, 0 if not. - * This is not the case if the remote peer address is not validated and if - * it cannot send at least QUIC_INITIAL_PACKET_MINLEN bytes. - */ -int qc_may_probe_ipktns(struct quic_conn *qc) -{ - return quic_peer_validated_addr(qc) || - quic_may_send_bytes(qc) >= QUIC_INITIAL_PACKET_MINLEN; -} - /* * Send a Version Negotiation packet on response to on socket to * address .