MINOR: quic: use the listener for Retry and Version Negotiation emission · haproxy/haproxy@4616641 · GitHub
Skip to content

Commit 4616641

Browse files
ygkata-denoyelle
authored andcommitted
MINOR: quic: use the listener for Retry and Version Negotiation emission
send_retry() and send_version_negotiation() take the listener socket FD as first argument, while send_stateless_reset() takes the listener instance. Make the first two also take the listener instance. Also rename their <addr> argument to <dst> to remove any ambiguity, as it is the destination of the emitted datagram, and fix send_stateless_reset() comment which still mentioned a FD. This patch does not introduce any functional change. It is a prerequisite for the following fixes on Retry, Stateless Reset and Version Negotiation emission. As such, it should be backported with them up to 2.8. Prior to 2.9, these functions are static functions defined in quic_conn.c.
1 parent 0690817 commit 4616641

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

‎include/haproxy/quic_tx.h‎

Lines changed: 2 additions & 2 deletions

‎src/quic_rx.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,7 +1845,7 @@ static struct quic_conn *quic_rx_pkt_retrieve_conn(struct quic_rx_packet *pkt,
18451845
/* Validate the token, retry or not only when connection is unknown. */
18461846
if (!quic_token_validate(pkt, dgram, l, qc, &token_odcid)) {
18471847
if (dgram->flags & QUIC_DGRAM_FL_SEND_RETRY) {
1848-
if (send_retry(l->rx.fd, (struct sockaddr_storage *)&dgram->saddr, pkt, pkt->version)) {
1848+
if (send_retry(l, (struct sockaddr_storage *)&dgram->saddr, pkt, pkt->version)) {
18491849
TRACE_ERROR("Error during Retry generation",
18501850
QUIC_EV_CONN_LPKT, NULL, NULL, NULL, pkt->version);
18511851
}
@@ -1875,7 +1875,7 @@ static struct quic_conn *quic_rx_pkt_retrieve_conn(struct quic_rx_packet *pkt,
18751875

18761876
TRACE_PROTO("Initial without token, sending retry",
18771877
QUIC_EV_CONN_LPKT, NULL, NULL, NULL, pkt->version);
1878-
if (send_retry(l->rx.fd, (struct sockaddr_storage *)&dgram->saddr, pkt, pkt->version)) {
1878+
if (send_retry(l, (struct sockaddr_storage *)&dgram->saddr, pkt, pkt->version)) {
18791879
TRACE_ERROR("Error during Retry generation",
18801880
QUIC_EV_CONN_LPKT, NULL, NULL, NULL, pkt->version);
18811881
goto out;
@@ -2054,7 +2054,7 @@ static int quic_rx_pkt_parse(struct quic_conn *qc, struct quic_rx_packet *pkt,
20542054
*/
20552055
if (l && !pkt->version) {
20562056
/* unsupported version, send Negotiation packet */
2057-
if (send_version_negotiation(l->rx.fd, (struct sockaddr_storage *)&dgram->saddr, pkt)) {
2057+
if (send_version_negotiation(l, (struct sockaddr_storage *)&dgram->saddr, pkt)) {
20582058
TRACE_ERROR("VN packet not sent", QUIC_EV_CONN_LPKT);
20592059
goto drop_silent;
20602060
}

‎src/quic_tx.c‎

Lines changed: 13 additions & 13 deletions

0 commit comments

Comments
 (0)