]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Replace max_packet_size by max_udp_payload size.
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 17 May 2021 14:42:21 +0000 (16:42 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Sep 2021 13:27:25 +0000 (15:27 +0200)
The name the maximum packet size transport parameter was ambiguous and replaced
by maximum UDP payload size. Our code would be also ambiguous if it does not
reflect this change.

include/haproxy/xprt_quic-t.h
include/haproxy/xprt_quic.h
src/xprt_quic.c

index 368b5cba83e16f611fbf861b62a298d3419d6cef..bf4f5f504f7f3db7bd779e603634ac2e726d3160 100644 (file)
@@ -257,15 +257,15 @@ struct preferred_address {
 };
 
 /* Default values for some of transport parameters */
-#define QUIC_DFLT_MAX_PACKET_SIZE     65527
-#define QUIC_DFLT_ACK_DELAY_COMPONENT     3 /* milliseconds */
-#define QUIC_DFLT_MAX_ACK_DELAY          25 /* milliseconds */
+#define QUIC_DFLT_MAX_UDP_PAYLOAD_SIZE   65527 /* bytes */
+#define QUIC_DFLT_ACK_DELAY_COMPONENT        3 /* milliseconds */
+#define QUIC_DFLT_MAX_ACK_DELAY             25 /* milliseconds */
 
 /* Types of QUIC transport parameters */
 #define QUIC_TP_ORIGINAL_DESTINATION_CONNECTION_ID   0
 #define QUIC_TP_IDLE_TIMEOUT                         1
 #define QUIC_TP_STATELESS_RESET_TOKEN                2
-#define QUIC_TP_MAX_PACKET_SIZE                      3
+#define QUIC_TP_MAX_UDP_PAYLOAD_SIZE                 3
 #define QUIC_TP_INITIAL_MAX_DATA                     4
 #define QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL   5
 #define QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE  6
@@ -294,15 +294,15 @@ struct preferred_address {
  */
 struct quic_transport_params {
        uint64_t idle_timeout;
-       uint64_t max_packet_size;                                      /* Default: 65527 (max of UDP payload for IPv6) */
+       uint64_t max_udp_payload_size;                 /* Default: 65527 bytes (max of UDP payload for IPv6) */
        uint64_t initial_max_data;
        uint64_t initial_max_stream_data_bidi_local;
        uint64_t initial_max_stream_data_bidi_remote;
        uint64_t initial_max_stream_data_uni;
        uint64_t initial_max_streams_bidi;
        uint64_t initial_max_streams_uni;
-       uint64_t ack_delay_exponent;                                   /* Default: 3, max: 20 */
-       uint64_t max_ack_delay;                                        /* Default: 3ms, max: 2^14ms*/
+       uint64_t ack_delay_exponent;                   /* Default: 3, max: 20 */
+       uint64_t max_ack_delay;                        /* Default: 3ms, max: 2^14ms*/
        uint64_t active_connection_id_limit;
 
        /* Booleans */
index ce01a647871e32596f754f3471f40ccdf15028c3..1e4d684a148eac3f1b7d498891765fa84bc4df6b 100644 (file)
@@ -422,9 +422,9 @@ static inline unsigned int quic_ack_delay_ms(struct quic_ack *ack_frm,
  */
 static inline void quic_dflt_transport_params_cpy(struct quic_transport_params *dst)
 {
-       dst->max_packet_size    = quic_dflt_transport_params.max_packet_size;
-       dst->ack_delay_exponent = quic_dflt_transport_params.ack_delay_exponent;
-       dst->max_ack_delay      = quic_dflt_transport_params.max_ack_delay;
+       dst->max_udp_payload_size = quic_dflt_transport_params.max_udp_payload_size;
+       dst->ack_delay_exponent   = quic_dflt_transport_params.ack_delay_exponent;
+       dst->max_ack_delay        = quic_dflt_transport_params.max_ack_delay;
 }
 
 /* Initialize <p> transport parameters depending <server> boolean value which
@@ -582,8 +582,8 @@ static inline int quic_transport_param_decode(struct quic_transport_params *p,
                if (!quic_dec_int(&p->idle_timeout, buf, end))
                        return 0;
                break;
-       case QUIC_TP_MAX_PACKET_SIZE:
-               if (!quic_dec_int(&p->max_packet_size, buf, end))
+       case QUIC_TP_MAX_UDP_PAYLOAD_SIZE:
+               if (!quic_dec_int(&p->max_udp_payload_size, buf, end))
                        return 0;
                break;
        case QUIC_TP_INITIAL_MAX_DATA:
@@ -764,8 +764,8 @@ static inline int quic_transport_params_encode(unsigned char *buf,
         * "max_packet_size" transport parameter must be transmitted only if different
         * of the default value.
         */
-       if (p->max_packet_size != QUIC_DFLT_MAX_PACKET_SIZE &&
-           !quic_transport_param_enc_int(&pos, end, QUIC_TP_MAX_PACKET_SIZE, p->max_packet_size))
+       if (p->max_udp_payload_size != QUIC_DFLT_MAX_UDP_PAYLOAD_SIZE &&
+           !quic_transport_param_enc_int(&pos, end, QUIC_TP_MAX_UDP_PAYLOAD_SIZE, p->max_udp_payload_size))
                return 0;
 
        if (p->initial_max_data &&
index d926b8210b8f0c8f23bcd91bed505a439380d2cc..327c3ce3a693bd223016691286972048d46a319b 100644 (file)
@@ -50,9 +50,9 @@
 #include <haproxy/xprt_quic.h>
 
 struct quic_transport_params quic_dflt_transport_params = {
-       .max_packet_size    = QUIC_DFLT_MAX_PACKET_SIZE,
-       .ack_delay_exponent = QUIC_DFLT_ACK_DELAY_COMPONENT,
-       .max_ack_delay      = QUIC_DFLT_MAX_ACK_DELAY,
+       .max_udp_payload_size = QUIC_DFLT_MAX_UDP_PAYLOAD_SIZE,
+       .ack_delay_exponent   = QUIC_DFLT_ACK_DELAY_COMPONENT,
+       .max_ack_delay        = QUIC_DFLT_MAX_ACK_DELAY,
 };
 
 /* trace source and events */