]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: quic: Move qc_may_probe_ipktns() to quic_tls.h
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 27 Nov 2023 16:28:40 +0000 (17:28 +0100)
committerFrédéric Lécaille <flecaille@haproxy.com>
Tue, 28 Nov 2023 14:37:50 +0000 (15:37 +0100)
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.

include/haproxy/quic_tls.h
include/haproxy/quic_tx.h
src/quic_tx.c

index 473545fefea8a9c475a43f81c743d11db1dcae91..86b8c1ee32c772fcf5cb82f01c8c3fe8d8eccf0b 100644 (file)
@@ -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 <qc> 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 */
index 8ec5d83bc49319488d9a545e73ae4368808d74f6..b81fa776efa255888bb1633aae0f2de0ac3dbc4c 100644 (file)
@@ -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);
index 5ac05713bccd037a6dd682414bb69542cab31444..57a0934459c060f5b580608e6c579bd595c30459 100644 (file)
@@ -1337,16 +1337,6 @@ int qc_dgrams_retransmit(struct quic_conn *qc)
        return ret;
 }
 
-/* Return 1 if <qc> 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 <pkt> on socket <fd> to
  * address <addr>.