From 9911b53d75277dd5dc30af955cc8dad9db698147 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 21 Aug 2024 17:15:59 +0200 Subject: [PATCH] CLEANUP: protocol: no longer initialize .receivers nor .nb_receivers Protocol definitions no longer need to initialize these internal fields, as they're now properly initialized during protocol registration. --- src/proto_quic.c | 4 ---- src/proto_sockpair.c | 2 -- src/proto_tcp.c | 4 ---- src/proto_udp.c | 4 ---- src/proto_uxdg.c | 2 -- src/proto_uxst.c | 2 -- 6 files changed, 18 deletions(-) diff --git a/src/proto_quic.c b/src/proto_quic.c index b77bcaeafb56..417c364f5031 100644 --- a/src/proto_quic.c +++ b/src/proto_quic.c @@ -104,8 +104,6 @@ struct protocol proto_quic4 = { .rx_unbind = sock_unbind, .rx_listening = quic_sock_accepting_conn, .default_iocb = quic_lstnr_sock_fd_iocb, - .receivers = LIST_HEAD_INIT(proto_quic4.receivers), - .nb_receivers = 0, #ifdef SO_REUSEPORT .flags = PROTO_F_REUSEPORT_SUPPORTED, #endif @@ -151,8 +149,6 @@ struct protocol proto_quic6 = { .rx_unbind = sock_unbind, .rx_listening = quic_sock_accepting_conn, .default_iocb = quic_lstnr_sock_fd_iocb, - .receivers = LIST_HEAD_INIT(proto_quic6.receivers), - .nb_receivers = 0, #ifdef SO_REUSEPORT .flags = PROTO_F_REUSEPORT_SUPPORTED, #endif diff --git a/src/proto_sockpair.c b/src/proto_sockpair.c index 00f817f6a04d..da98c620377a 100644 --- a/src/proto_sockpair.c +++ b/src/proto_sockpair.c @@ -95,8 +95,6 @@ struct protocol proto_sockpair = { .rx_unbind = sock_unbind, .rx_listening = sockpair_accepting_conn, .default_iocb = sock_accept_iocb, - .receivers = LIST_HEAD_INIT(proto_sockpair.receivers), - .nb_receivers = 0, }; INITCALL1(STG_REGISTER, protocol_register, &proto_sockpair); diff --git a/src/proto_tcp.c b/src/proto_tcp.c index d6552b2f122f..cf79ffbc543a 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -93,8 +93,6 @@ struct protocol proto_tcpv4 = { .rx_unbind = sock_unbind, .rx_listening = sock_accepting_conn, .default_iocb = sock_accept_iocb, - .receivers = LIST_HEAD_INIT(proto_tcpv4.receivers), - .nb_receivers = 0, #ifdef SO_REUSEPORT .flags = PROTO_F_REUSEPORT_SUPPORTED, #endif @@ -140,8 +138,6 @@ struct protocol proto_tcpv6 = { .rx_unbind = sock_unbind, .rx_listening = sock_accepting_conn, .default_iocb = sock_accept_iocb, - .receivers = LIST_HEAD_INIT(proto_tcpv6.receivers), - .nb_receivers = 0, #ifdef SO_REUSEPORT .flags = PROTO_F_REUSEPORT_SUPPORTED, #endif diff --git a/src/proto_udp.c b/src/proto_udp.c index 7308e988b9fc..bedc6f6cba01 100644 --- a/src/proto_udp.c +++ b/src/proto_udp.c @@ -72,8 +72,6 @@ struct protocol proto_udp4 = { .rx_enable = sock_enable, .rx_disable = sock_disable, .rx_unbind = sock_unbind, - .receivers = LIST_HEAD_INIT(proto_udp4.receivers), - .nb_receivers = 0, #ifdef SO_REUSEPORT .flags = PROTO_F_REUSEPORT_SUPPORTED, #endif @@ -109,8 +107,6 @@ struct protocol proto_udp6 = { .rx_enable = sock_enable, .rx_disable = sock_disable, .rx_unbind = sock_unbind, - .receivers = LIST_HEAD_INIT(proto_udp6.receivers), - .nb_receivers = 0, #ifdef SO_REUSEPORT .flags = PROTO_F_REUSEPORT_SUPPORTED, #endif diff --git a/src/proto_uxdg.c b/src/proto_uxdg.c index 43cbe5a92053..068cb9e72a9c 100644 --- a/src/proto_uxdg.c +++ b/src/proto_uxdg.c @@ -63,8 +63,6 @@ struct protocol proto_uxdg = { .rx_enable = sock_enable, .rx_disable = sock_disable, .rx_unbind = sock_unbind, - .receivers = LIST_HEAD_INIT(proto_uxdg.receivers), - .nb_receivers = 0, }; INITCALL1(STG_REGISTER, protocol_register, &proto_uxdg); diff --git a/src/proto_uxst.c b/src/proto_uxst.c index a081a3afb94a..51f508c31d59 100644 --- a/src/proto_uxst.c +++ b/src/proto_uxst.c @@ -81,8 +81,6 @@ struct protocol proto_uxst = { .rx_unbind = sock_unbind, .rx_listening = sock_accepting_conn, .default_iocb = sock_accept_iocb, - .receivers = LIST_HEAD_INIT(proto_uxst.receivers), - .nb_receivers = 0, }; INITCALL1(STG_REGISTER, protocol_register, &proto_uxst);