From: Frédéric Lécaille Date: Mon, 17 May 2021 14:42:21 +0000 (+0200) Subject: MINOR: quic: Replace max_packet_size by max_udp_payload size. X-Git-Tag: v2.5-dev8~140 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=785c9c998a4e86f8a74ddbef811b3748113e3483;p=thirdparty%2Fhaproxy.git MINOR: quic: Replace max_packet_size by max_udp_payload size. 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. --- diff --git a/include/haproxy/xprt_quic-t.h b/include/haproxy/xprt_quic-t.h index 368b5cba83..bf4f5f504f 100644 --- a/include/haproxy/xprt_quic-t.h +++ b/include/haproxy/xprt_quic-t.h @@ -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 */ diff --git a/include/haproxy/xprt_quic.h b/include/haproxy/xprt_quic.h index ce01a64787..1e4d684a14 100644 --- a/include/haproxy/xprt_quic.h +++ b/include/haproxy/xprt_quic.h @@ -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

transport parameters depending 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 && diff --git a/src/xprt_quic.c b/src/xprt_quic.c index d926b8210b..327c3ce3a6 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -50,9 +50,9 @@ #include 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 */