MINOR: quic: Store the next connection IDs sequence number in the connection
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 6 Mar 2023 13:07:59 +0000 (14:07 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 8 Mar 2023 07:50:54 +0000 (08:50 +0100)
commitb4c5471425134900948b1e0a642e9eaac40b6ef4
treeb416bec8afcda1e76d414de5e124de3eaa3256cf
parent4afbca611fad4adbeb2d967dc833ab2e06011dd1
MINOR: quic: Store the next connection IDs sequence number in the connection

Add ->next_cid_seq_num new member to quic_conn struct to store the next
connection ID to be used to alloacated a connection ID.
It is initialized to 0 from qc_new_conn() which initializes a connection.
Modify new_quic_cid() to use this variable each time it is called without
giving the possibility to the caller to pass the sequence number for the
connection to be allocated.

Modify quic_build_post_handshake_frames() to use ->next_cid_seq_num
when building NEW_CONNECTION_ID frames after the hanshake has been completed.
Limit the number of connection IDs provided to the peer to the minimum
between 4 and the value it sent with active_connection_id_limit transport
parameter. This includes the connection ID used by the connection to send
this new connection IDs.

Must be backported to 2.7.
include/haproxy/quic_conn-t.h
src/quic_conn.c