From: Willy Tarreau Date: Thu, 12 Jan 2023 19:20:57 +0000 (+0100) Subject: MINOR: listener: remove the now useless LI_F_QUIC_LISTENER flag X-Git-Tag: v2.8-dev3~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e2682afed98aaacfb2afda8ffccbeffc0d8ce91;p=thirdparty%2Fhaproxy.git MINOR: listener: remove the now useless LI_F_QUIC_LISTENER flag This flag is only used to tag a QUIC listener, which we now know by its bind_conf's xprt as well. It's only used to decide whether or not to perform an extra initialization step on the listener. Let's drop it as well as the flags field. With the various fields and options moved, the listener struct reduced by 48 bytes total. --- diff --git a/include/haproxy/listener-t.h b/include/haproxy/listener-t.h index 6e5c4238ed..78c6b9a938 100644 --- a/include/haproxy/listener-t.h +++ b/include/haproxy/listener-t.h @@ -219,7 +219,6 @@ struct li_per_thread { struct listener *li; /* back reference on the listener */ }; -#define LI_F_QUIC_LISTENER 0x00000001 /* listener uses proto quic */ /* The listener will be directly referenced by the fdtab[] which holds its * socket. The listener provides the protocol-specific accept() function to @@ -230,12 +229,11 @@ struct listener { enum li_state state; /* state: NEW, INIT, ASSIGNED, LISTEN, READY, FULL */ /* 2-byte hole here */ int luid; /* listener universally unique ID, used for SNMP */ - int flags; /* LI_F_* flags */ + int nbconn; /* current number of connections on this listener */ unsigned int thr_idx; /* thread indexes for queue distribution : (t2<<16)+t1 */ __decl_thread(HA_RWLOCK_T lock); struct fe_counters *counters; /* statistics counters */ - int nbconn; /* current number of connections on this listener */ struct mt_list wait_queue; /* link element to make the listener wait for something (LI_LIMITED) */ char *name; /* listener's name */ diff --git a/src/cfgparse.c b/src/cfgparse.c index 664a24a178..78b32ee842 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -4316,7 +4316,7 @@ init_proxies_list_stage2: } #ifdef USE_QUIC - if (listener->flags & LI_F_QUIC_LISTENER) { + if (listener->bind_conf->xprt == xprt_get(XPRT_QUIC)) { if (!global.cluster_secret) { diag_no_cluster_secret = 1; if (listener->bind_conf->options & BC_O_QUIC_FORCE_RETRY) { diff --git a/src/proto_quic.c b/src/proto_quic.c index 217edd9a0b..9d27553103 100644 --- a/src/proto_quic.c +++ b/src/proto_quic.c @@ -526,7 +526,6 @@ int quic_connect_server(struct connection *conn, int flags) */ static void quic_add_listener(struct protocol *proto, struct listener *listener) { - listener->flags |= LI_F_QUIC_LISTENER; listener->rx.flags |= RX_F_LOCAL_ACCEPT; default_add_listener(proto, listener);