]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: listener: replace bind_conf->quic_force_retry with BC_O_QUIC_FORCE_RETRY
authorWilly Tarreau <w@1wt.eu>
Fri, 20 May 2022 14:06:01 +0000 (16:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 20 May 2022 16:41:51 +0000 (18:41 +0200)
It was only set and used once, let's replace it now and take it out of
the ifdef.

include/haproxy/listener-t.h
src/cfgparse-quic.c
src/xprt_quic.c

index ac50a4607527b14cd3363721d5f776c75b32a257..6f4ae2fadb3f1701f18b1d07ec8b74f732368f89 100644 (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) */
index 03f4178259c3bc43e507a9e9639d9ede53ca63a4..db637e0800d7e5e141f96bc1d77083a3531bbba8 100644 (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;
 }
 
index b2b1f60827041d464d52e365152f239142820d81..444b7acf7df106849565a21134770f33cf7cf255 100644 (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)) {