]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: quic: fix invalid conn reject with CONNECTION_REFUSED
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 26 Jul 2024 13:24:35 +0000 (15:24 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 26 Jul 2024 13:24:35 +0000 (15:24 +0200)
quic-initial rules were implemented just recently. For some actions, a
new flags field was added in quic_dgram structure. This is used to
report the result of the rules execution.

However, this flags field was left uninitialized. Depending on its
value, it may close the connection to be wrongly rejected via
CONNECTION_REFUSED. Fix this by properly set flags value to 0.

No need to backport.

src/quic_sock.c

index 4049fc9b583a19595f46964869ec2a6a43699e6b..a894396497fc012500835cd4463ea0ff99e593a3 100644 (file)
@@ -295,6 +295,7 @@ static int quic_lstnr_dgram_dispatch(unsigned char *pos, size_t len, void *owner
        dgram->saddr = *saddr;
        dgram->daddr = *daddr;
        dgram->qc = NULL;
+       dgram->flags = 0;
 
        /* Attached datagram to its quic_receiver_buf and quic_dghdlrs. */
        LIST_APPEND(dgrams, &dgram->recv_list);
@@ -859,6 +860,7 @@ int qc_rcv_buf(struct quic_conn *qc)
                new_dgram->saddr = saddr;
                new_dgram->daddr = daddr;
                new_dgram->qc = NULL;  /* set later via quic_dgram_parse() */
+               new_dgram->flags = 0;
 
                TRACE_DEVEL("read datagram", QUIC_EV_CONN_RCV, qc, new_dgram);