mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-23 06:41:32 +02:00
CLEANUP: listener: replace bind_conf->quic_force_retry with BC_O_QUIC_FORCE_RETRY
It was only set and used once, let's replace it now and take it out of the ifdef.
This commit is contained in:
parent
1ea6e6a17f
commit
787e92a4fb
@ -116,6 +116,7 @@ enum li_status {
|
|||||||
/* flags used with bind_conf->options */
|
/* flags used with bind_conf->options */
|
||||||
#define BC_O_USE_SSL 0x00000001 /* SSL is being used on this bind_conf */
|
#define BC_O_USE_SSL 0x00000001 /* SSL is being used on this bind_conf */
|
||||||
#define BC_O_GENERATE_CERTS 0x00000002 /* 1 if generate-certificates option is set, else 0 */
|
#define BC_O_GENERATE_CERTS 0x00000002 /* 1 if generate-certificates option is set, else 0 */
|
||||||
|
#define BC_O_QUIC_FORCE_RETRY 0x00000004 /* always send Retry on reception of Initial without token */
|
||||||
|
|
||||||
|
|
||||||
/* flags used with bind_conf->ssl_options */
|
/* flags used with bind_conf->ssl_options */
|
||||||
@ -176,7 +177,6 @@ struct bind_conf {
|
|||||||
#endif
|
#endif
|
||||||
#ifdef USE_QUIC
|
#ifdef USE_QUIC
|
||||||
struct quic_transport_params quic_params; /* QUIC transport parameters. */
|
struct quic_transport_params quic_params; /* QUIC transport parameters. */
|
||||||
unsigned int quic_force_retry:1; /* always send Retry on reception of Initial without token */
|
|
||||||
#endif
|
#endif
|
||||||
struct proxy *frontend; /* the frontend all these listeners belong to, or NULL */
|
struct proxy *frontend; /* the frontend all these listeners belong to, or NULL */
|
||||||
const struct mux_proto_list *mux_proto; /* the mux to use for all incoming connections (specified by the "proto" keyword) */
|
const struct mux_proto_list *mux_proto; /* the mux to use for all incoming connections (specified by the "proto" keyword) */
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
static int bind_parse_quic_force_retry(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
|
static int bind_parse_quic_force_retry(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
|
||||||
{
|
{
|
||||||
conf->quic_force_retry = 1;
|
conf->options |= BC_O_QUIC_FORCE_RETRY;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5328,7 +5328,7 @@ static void qc_lstnr_pkt_rcv(unsigned char *buf, const unsigned char *end,
|
|||||||
*/
|
*/
|
||||||
if (global.cluster_secret) {
|
if (global.cluster_secret) {
|
||||||
if (!token_len) {
|
if (!token_len) {
|
||||||
if (l->bind_conf->quic_force_retry) {
|
if (l->bind_conf->options & BC_O_QUIC_FORCE_RETRY) {
|
||||||
TRACE_PROTO("Initial without token, sending retry", QUIC_EV_CONN_LPKT);
|
TRACE_PROTO("Initial without token, sending retry", QUIC_EV_CONN_LPKT);
|
||||||
if (send_retry(l->rx.fd, &dgram->saddr, pkt)) {
|
if (send_retry(l->rx.fd, &dgram->saddr, pkt)) {
|
||||||
TRACE_PROTO("Error during Retry generation", QUIC_EV_CONN_LPKT);
|
TRACE_PROTO("Error during Retry generation", QUIC_EV_CONN_LPKT);
|
||||||
@ -5393,7 +5393,7 @@ static void qc_lstnr_pkt_rcv(unsigned char *buf, const unsigned char *end,
|
|||||||
goto drop;
|
goto drop;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (global.cluster_secret && !pkt->token_len && !l->bind_conf->quic_force_retry &&
|
if (global.cluster_secret && !pkt->token_len && !(l->bind_conf->options & BC_O_QUIC_FORCE_RETRY) &&
|
||||||
HA_ATOMIC_LOAD(&prx_counters->conn_opening) >= global.tune.quic_retry_threshold) {
|
HA_ATOMIC_LOAD(&prx_counters->conn_opening) >= global.tune.quic_retry_threshold) {
|
||||||
TRACE_PROTO("Initial without token, sending retry", QUIC_EV_CONN_LPKT);
|
TRACE_PROTO("Initial without token, sending retry", QUIC_EV_CONN_LPKT);
|
||||||
if (send_retry(l->rx.fd, &dgram->saddr, pkt)) {
|
if (send_retry(l->rx.fd, &dgram->saddr, pkt)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user