BUG/MEDIUM: quic: fix invalid conn reject with CONNECTION_REFUSED

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.
This commit is contained in:
Amaury Denoyelle 2024-07-26 15:24:35 +02:00
parent 08515af9df
commit 85131f91bf

View File

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