]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic-be: Version Information transport parameter check
authorFrederic Lecaille <flecaille@haproxy.com>
Wed, 17 Jan 2024 17:14:44 +0000 (18:14 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 11 Jun 2025 16:37:34 +0000 (18:37 +0200)
Add a little check to verify that the version chosen by the server matches
with the client one. Initiliazes local transport parameters ->negotiated_version
value with this version if this is the case. If not, return 0;

src/quic_tp.c

index 2e5e47d61c209f0524c57ec3602e7437dd0f8217..caf66577e9fc4b617ea6b207f93911c5051ad714 100644 (file)
@@ -213,9 +213,18 @@ static int quic_transport_param_dec_version_info(struct tp_version_information *
                        return 0;
        }
 
-       if (server)
-               /* TODO: not supported */
+       if (server) {
+               int i;
+
+               for (i = 0; i < quic_versions_nb; i++) {
+                       if (tp->chosen == quic_versions[i].num) {
+                               tp->negotiated_version = &quic_versions[i];
+                               goto out;
+                       }
+               }
+
                return 0;
+       }
 
        for (ver = others; ver < end; ver += 4) {
                if (!tp->negotiated_version) {