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:
Willy Tarreau 2022-05-20 16:06:01 +02:00
parent 1ea6e6a17f
commit 787e92a4fb
3 changed files with 4 additions and 4 deletions

View File

@ -116,6 +116,7 @@ enum li_status {
/* flags used with bind_conf->options */
#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_QUIC_FORCE_RETRY 0x00000004 /* always send Retry on reception of Initial without token */
/* flags used with bind_conf->ssl_options */
@ -176,7 +177,6 @@ struct bind_conf {
#endif
#ifdef USE_QUIC
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
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) */

View File

@ -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)
{
conf->quic_force_retry = 1;
conf->options |= BC_O_QUIC_FORCE_RETRY;
return 0;
}

View File

@ -5328,7 +5328,7 @@ static void qc_lstnr_pkt_rcv(unsigned char *buf, const unsigned char *end,
*/
if (global.cluster_secret) {
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);
if (send_retry(l->rx.fd, &dgram->saddr, pkt)) {
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;
}
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) {
TRACE_PROTO("Initial without token, sending retry", QUIC_EV_CONN_LPKT);
if (send_retry(l->rx.fd, &dgram->saddr, pkt)) {