From 12c169aaf0a09dfb9a3115acb3fafd9a248c5799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Thu, 10 Mar 2022 10:00:36 +0100 Subject: [PATCH] BUG/MINOR: quic: ACK_REQUIRED and ACK_RECEIVED flag collision This packet number space flags were defined with the same value because defined at different places in the file. Assemble them at the same location with different values. This bug could unvalidate the peer address after it was validated during the handshake leading to the anti-amplication limit to be enabled again after having been disabled. The situation could not be unblocked (deadlock). --- include/haproxy/xprt_quic-t.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/haproxy/xprt_quic-t.h b/include/haproxy/xprt_quic-t.h index 4174924f1..5b37d7779 100644 --- a/include/haproxy/xprt_quic-t.h +++ b/include/haproxy/xprt_quic-t.h @@ -391,6 +391,10 @@ struct quic_arngs { #define QUIC_FL_PKTNS_ACK_RECEIVED_BIT 0 #define QUIC_FL_PKTNS_ACK_RECEIVED (1UL << QUIC_FL_PKTNS_ACK_RECEIVED_BIT) +/* Flag the packet number space as requiring an ACK frame to be sent. */ +#define QUIC_FL_PKTNS_ACK_REQUIRED_BIT 1 +#define QUIC_FL_PKTNS_ACK_REQUIRED (1UL << QUIC_FL_PKTNS_ACK_REQUIRED_BIT) + /* The maximum number of dgrams which may be sent upon PTO expirations. */ #define QUIC_MAX_NB_PTO_DGRAMS 2 @@ -643,10 +647,6 @@ enum qc_mux_state { #define QUIC_CONN_TX_BUFS_NB 8 #define QUIC_CONN_TX_BUF_SZ QUIC_PACKET_MAXLEN -/* Flag the packet number space as requiring an ACK frame to be sent. */ -#define QUIC_FL_PKTNS_ACK_REQUIRED_BIT 0 -#define QUIC_FL_PKTNS_ACK_REQUIRED (1UL << QUIC_FL_PKTNS_ACK_REQUIRED_BIT) - /* Flags at connection level */ #define QUIC_FL_CONN_ANTI_AMPLIFICATION_REACHED_BIT 0 #define QUIC_FL_CONN_ANTI_AMPLIFICATION_REACHED \