quic: update to quicly version 0.1.5 42/41842/8
authorDave Wallace <dwallacelf@gmail.com>
Sat, 16 Nov 2024 06:26:42 +0000 (01:26 -0500)
committerFlorin Coras <florin.coras@gmail.com>
Tue, 19 Nov 2024 16:47:02 +0000 (16:47 +0000)
Type: improvement

Change-Id: I7c9c91a9c4d3ac2499e42eedda0a5d395bdf5912
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
build/external/packages/quicly.mk
build/external/patches/quicly_0.1.5-vpp/0001-cmake-install.patch [new file with mode: 0644]
build/external/patches/quicly_0.1.5-vpp/0002-cmake-install-picotls.patch [new file with mode: 0644]
src/plugins/quic/CMakeLists.txt
src/plugins/quic/quic.c
src/plugins/quic/quic.h
src/plugins/tlspicotls/CMakeLists.txt

index e8c1b42..23fbd58 100644 (file)
@@ -11,9 +11,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-quicly_version := 0.1.4-vpp
+quicly_version := 0.1.5-vpp
 quicly_tarball := quicly_$(quicly_version).tar.gz
-quicly_tarball_md5sum := 5419a0f340c5572bcf682c08acc84c77
+quicly_tarball_md5sum := fc388ccde2f7d677b92ff3cb3fd387e4
 quicly_tarball_strip_dirs := 1
 quicly_url := https://github.com/vpp-quic/quicly/releases/download/v$(quicly_version)/quicly_$(quicly_version).tar.gz
 
diff --git a/build/external/patches/quicly_0.1.5-vpp/0001-cmake-install.patch b/build/external/patches/quicly_0.1.5-vpp/0001-cmake-install.patch
new file mode 100644 (file)
index 0000000..35befd9
--- /dev/null
@@ -0,0 +1,30 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5142bac..7b95f74 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -33,6 +33,8 @@ ENDIF(NOT CMAKE_BUILD_TYPE)
+ SET(CMAKE_C_FLAGS "-std=c99 -Wall -g ${CC_WARNING_FLAGS} ${CMAKE_C_FLAGS}")
+ SET(CMAKE_C_FLAGS_DEBUG "-O0")
+ SET(CMAKE_C_FLAGS_RELEASE "-O2")
++SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
++SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
+ INCLUDE_DIRECTORIES(
+     ${OPENSSL_INCLUDE_DIR}
+@@ -118,6 +120,16 @@ TARGET_LINK_LIBRARIES(examples-echo quicly ${OPENSSL_LIBRARIES} ${CMAKE_DL_LIBS}
+ ADD_EXECUTABLE(udpfw t/udpfw.c)
++INSTALL (
++    DIRECTORY ${CMAKE_SOURCE_DIR}/include/
++    DESTINATION include
++    FILES_MATCHING PATTERN "*.h")
++
++INSTALL(TARGETS quicly
++        RUNTIME DESTINATION bin
++        LIBRARY DESTINATION lib
++        ARCHIVE DESTINATION lib)
++
+ ADD_CUSTOM_TARGET(check env BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} WITH_DTRACE=${WITH_DTRACE} prove --exec "sh -c" -v ${CMAKE_CURRENT_BINARY_DIR}/*.t t/*.t
+     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+     DEPENDS cli test.t)
diff --git a/build/external/patches/quicly_0.1.5-vpp/0002-cmake-install-picotls.patch b/build/external/patches/quicly_0.1.5-vpp/0002-cmake-install-picotls.patch
new file mode 100644 (file)
index 0000000..56897e8
--- /dev/null
@@ -0,0 +1,30 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d1d6c09..90d7221 100644
+--- a/deps/picotls/CMakeLists.txt
++++ b/deps/picotls/CMakeLists.txt
+@@ -13,6 +13,9 @@ IF (WITH_DTRACE)
+ ENDIF ()
+ SET(CMAKE_C_FLAGS "-std=c99 -Wall -O2 -g ${CC_WARNING_FLAGS} ${CMAKE_C_FLAGS}")
++SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
++SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
++
+ INCLUDE_DIRECTORIES(
+     deps/cifra/src/ext
+     deps/cifra/src
+@@ -161,6 +164,15 @@ TARGET_LINK_LIBRARIES(ptlsbench ${PTLSBENCH_LIBS})
+ ADD_CUSTOM_TARGET(check env BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} prove --exec '' -v ${CMAKE_CURRENT_BINARY_DIR}/*.t t/*.t WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${TEST_EXES} cli)
++INSTALL (DIRECTORY ${CMAKE_SOURCE_DIR}/include/
++    DESTINATION include
++    FILES_MATCHING PATTERN "*.h")
++
++INSTALL(TARGETS picotls-core picotls-openssl
++        RUNTIME DESTINATION bin
++        LIBRARY DESTINATION lib
++        ARCHIVE DESTINATION lib)
++
+ IF (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+      SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -pthread ${CMAKE_C_FLAGS}")
+ ELSEIF ("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS")
index 65bdc32..4f408ca 100644 (file)
@@ -18,7 +18,7 @@ if(NOT OPENSSL_FOUND)
 endif()
 
 unset(QUIC_LINK_LIBRARIES)
-set(EXPECTED_QUICLY_VERSION "0.1.4-vpp")
+set(EXPECTED_QUICLY_VERSION "0.1.5-vpp")
 
 vpp_find_path(QUICLY_INCLUDE_DIR NAMES quicly.h)
 vpp_find_path(PICOTLS_INCLUDE_DIR NAMES picotls.h)
index 3797cd2..15a5263 100644 (file)
@@ -250,7 +250,6 @@ quic_init_crypto_context (crypto_context_t * crctx, quic_ctx_t * ctx)
   ptls_ctx->cipher_suites = qm->quic_ciphers[ctx->crypto_engine];
   ptls_ctx->certificates.list = NULL;
   ptls_ctx->certificates.count = 0;
-  ptls_ctx->esni = NULL;
   ptls_ctx->on_client_hello = NULL;
   ptls_ctx->emit_certificate = NULL;
   ptls_ctx->sign_certificate = NULL;
@@ -718,7 +717,6 @@ quic_send_packets (quic_ctx_t * ctx)
   session_t *udp_session;
   quicly_conn_t *conn;
   size_t num_packets, i, max_packets;
-  quicly_address_t dest, src;
   u32 n_sent = 0;
   int err = 0;
 
@@ -744,17 +742,16 @@ quic_send_packets (quic_ctx_t * ctx)
        break;
 
       num_packets = max_packets;
-      if ((err = quicly_send (conn, &dest, &src, packets, &num_packets, buf,
-                             sizeof (buf))))
+      if ((err = quicly_send (conn, &ctx->rmt_ip, &ctx->lcl_ip, packets,
+                             &num_packets, buf, sizeof (buf))))
        goto quicly_error;
 
       for (i = 0; i != num_packets; ++i)
        {
 
-         if ((err =
-                quic_send_datagram (udp_session, &packets[i], &dest, &src)))
-           goto quicly_error;
-
+         if ((err = quic_send_datagram (udp_session, &packets[i],
+                                        &ctx->rmt_ip, &ctx->lcl_ip)))
+         goto quicly_error;
        }
       n_sent += num_packets;
     }
@@ -1848,10 +1845,10 @@ quic_udp_session_connected_callback (u32 quic_app_index, u32 ctx_index,
   quic_build_sockaddr (sa, &salen, &tc->rmt_ip, tc->rmt_port, tc->is_ip4);
 
   quicly_ctx = quic_get_quicly_ctx_from_ctx (ctx);
-  ret = quicly_connect (&ctx->conn, quicly_ctx, (char *) ctx->srv_hostname,
-                       sa, NULL, &quic_main.wrk_ctx[thread_index].next_cid,
+  ret = quicly_connect (&ctx->conn, quicly_ctx, (char *) ctx->srv_hostname, sa,
+                       NULL, &quic_main.wrk_ctx[thread_index].next_cid,
                        ptls_iovec_init (NULL, 0), &quic_main.hs_properties,
-                       NULL);
+                       NULL, NULL);
   ++quic_main.wrk_ctx[thread_index].next_cid.master_id;
   /*  Save context handle in quicly connection */
   quic_store_conn_ctx (ctx->conn, ctx);
@@ -2103,10 +2100,9 @@ quic_accept_connection (quic_rx_packet_ctx_t * pctx)
     }
 
   quicly_ctx = quic_get_quicly_ctx_from_ctx (ctx);
-  if ((rv = quicly_accept (&conn, quicly_ctx, NULL, &pctx->sa,
-                          &pctx->packet, NULL,
-                          &quic_main.wrk_ctx[pctx->thread_index].next_cid,
-                          NULL)))
+  if ((rv = quicly_accept (
+        &conn, quicly_ctx, NULL, &pctx->sa, &pctx->packet, NULL,
+        &quic_main.wrk_ctx[pctx->thread_index].next_cid, NULL, NULL)))
     {
       /* Invalid packet, pass */
       assert (conn == NULL);
@@ -2192,12 +2188,8 @@ quic_reset_connection (u64 udp_session_handle, quic_rx_packet_ctx_t * pctx)
   packet.iov_len = payload_len;
   packet.iov_base = payload;
 
-  struct _st_quicly_conn_public_t *conn =
-    (struct _st_quicly_conn_public_t *) qctx->conn;
-
   udp_session = session_get_from_handle (udp_session_handle);
-  rv = quic_send_datagram (udp_session, &packet, &conn->remote.address,
-                          &conn->local.address);
+  rv = quic_send_datagram (udp_session, &packet, &qctx->rmt_ip, &qctx->lcl_ip);
   quic_set_udp_tx_evt (udp_session);
   return rv;
 }
index 2c5a21c..081bcb1 100644 (file)
@@ -179,6 +179,8 @@ typedef struct quic_ctx_
     ptls_aead_context_t *aead_ctx;
   } ingress_keys;
   int key_phase_ingress;
+  quicly_address_t rmt_ip;
+  quicly_address_t lcl_ip;
 
 } quic_ctx_t;
 
index e60a0e0..3d16ded 100644 (file)
@@ -10,7 +10,7 @@ endif()
 # it's reasonable to make this check to avoid breaking
 # existing builds when upgrading the quicly/picotls
 # versions
-set(EXPECTED_QUICLY_VERSION "0.1.4-vpp")
+set(EXPECTED_QUICLY_VERSION "0.1.5-vpp")
 
 
 vpp_find_path(QUICLY_INCLUDE_DIR NAMES quicly.h)