diff options
author | MathiasRaoul <mathias.raoul@gmail.com> | 2020-02-07 16:29:05 +0000 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2020-03-27 17:43:33 +0000 |
commit | ffdc72da4f086e9a62b946970778495bba400e69 (patch) | |
tree | 3633cea2b6aa5f862eccc85a7e80d9db66d6aa96 /src/plugins/quic | |
parent | 4e149776890a5ac91bb14957d57def3c73325061 (diff) |
quic: Check quicly version tag at compile time
- updates the quicly version to 0.1.0-vpp
- adds workaround for quicly_send()/assert_consistency() failure
Type: feature
Change-Id: I4c7e0ffc720ad9a685b89046a83646d59febd6cd
Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src/plugins/quic')
-rw-r--r-- | src/plugins/quic/CMakeLists.txt | 42 | ||||
-rw-r--r-- | src/plugins/quic/quic.c | 18 |
2 files changed, 33 insertions, 27 deletions
diff --git a/src/plugins/quic/CMakeLists.txt b/src/plugins/quic/CMakeLists.txt index 43fb483a7bc..859b6d98c4c 100644 --- a/src/plugins/quic/CMakeLists.txt +++ b/src/plugins/quic/CMakeLists.txt @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -message(STATUS "Looking for quicly") unset(QUIC_LINK_LIBRARIES) +set(EXPECTED_QUICLY_VERSION "0.1.0-vpp") find_path(QUICLY_INCLUDE_DIR NAMES quicly.h) find_path(PICOTLS_INCLUDE_DIR NAMES picotls.h) @@ -28,22 +28,32 @@ list(APPEND QUIC_LINK_LIBRARIES ) if(QUICLY_INCLUDE_DIR AND QUIC_LINK_LIBRARIES) - include_directories (${QUICLY_INCLUDE_DIR}) - - if(PICOTLS_INCLUDE_DIR) - include_directories (${PICOTLS_INCLUDE_DIR}) + if(EXISTS "${QUICLY_INCLUDE_DIR}/quicly/version.h") + file(STRINGS "${QUICLY_INCLUDE_DIR}/quicly/version.h" quicly_version_str REGEX "^#define[\t ]+LIBQUICLY_VERSION[\t ]+\".*\"") + string(REGEX REPLACE "^#define[\t ]+LIBQUICLY_VERSION[\t ]+\"([^\"]*)\".*" "\\1" QUICLY_VERSION_STRING "${quicly_version_str}") + unset(quicly_version_str) endif() - add_vpp_plugin(quic - SOURCES - certs.c - error.c - quic.c - quic_crypto.c - - LINK_LIBRARIES ${QUIC_LINK_LIBRARIES} - ) - message(STATUS "Found quicly in ${QUICLY_INCLUDE_DIR}") + if (${QUICLY_VERSION_STRING} MATCHES "${EXPECTED_QUICLY_VERSION}") + include_directories (${QUICLY_INCLUDE_DIR}) + + if(PICOTLS_INCLUDE_DIR) + include_directories (${PICOTLS_INCLUDE_DIR}) + endif() + + add_vpp_plugin(quic + SOURCES + certs.c + error.c + quic.c + quic_crypto.c + + LINK_LIBRARIES ${QUIC_LINK_LIBRARIES} + ) + message(STATUS "Found quicly ${EXPECTED_QUICLY_VERSION} in ${QUICLY_INCLUDE_DIR}") + else() + message(STATUS "-- quicly ${EXPECTED_QUICLY_VERSION} not found - QUIC plugin disabled") + endif() else() - message(WARNING "-- quicly not found - quic_plugin disabled") + message(WARNING "-- quicly headers not found - QUIC plugin disabled") endif() diff --git a/src/plugins/quic/quic.c b/src/plugins/quic/quic.c index 03e46c60616..3991656cefa 100644 --- a/src/plugins/quic/quic.c +++ b/src/plugins/quic/quic.c @@ -784,7 +784,7 @@ quic_on_stream_destroy (quicly_stream_t * stream, int err) clib_mem_free (stream->data); } -static int +static void quic_on_stop_sending (quicly_stream_t * stream, int err) { #if QUIC_DEBUG >= 2 @@ -797,10 +797,9 @@ quic_on_stop_sending (quicly_stream_t * stream, int err) session_handle (stream_session), quic_format_err, err); #endif /* TODO : handle STOP_SENDING */ - return 0; } -static int +static void quic_on_receive_reset (quicly_stream_t * stream, int err) { quic_stream_data_t *stream_data = (quic_stream_data_t *) stream->data; @@ -813,10 +812,9 @@ quic_on_receive_reset (quicly_stream_t * stream, int err) session_handle (stream_session), quic_format_err, err); #endif session_transport_closing_notify (&sctx->connection); - return 0; } -static int +static void quic_on_receive (quicly_stream_t * stream, size_t off, const void *src, size_t len) { @@ -846,7 +844,7 @@ quic_on_receive (quicly_stream_t * stream, size_t off, const void *src, stream_session->thread_index, f, max_enq, len, stream_data->app_rx_data_len, off, off - stream_data->app_rx_data_len + len); - return 0; + return; } if (PREDICT_FALSE ((off - stream_data->app_rx_data_len + len) > max_enq)) { @@ -858,7 +856,7 @@ quic_on_receive (quicly_stream_t * stream, size_t off, const void *src, stream_session->thread_index, f, max_enq, len, stream_data->app_rx_data_len, off, off - stream_data->app_rx_data_len + len); - return 1; + return; /* This shouldn't happen */ } if (off == stream_data->app_rx_data_len) { @@ -888,7 +886,7 @@ quic_on_receive (quicly_stream_t * stream, size_t off, const void *src, len, (u8 *) src); QUIC_ASSERT (rlen == 0); } - return 0; + return; } void @@ -912,7 +910,7 @@ quic_fifo_egress_shift (quicly_stream_t * stream, size_t delta) QUIC_ASSERT (!rv); } -int +void quic_fifo_egress_emit (quicly_stream_t * stream, size_t off, void *dst, size_t * len, int *wrote_all) { @@ -944,8 +942,6 @@ quic_fifo_egress_emit (quicly_stream_t * stream, size_t off, void *dst, stream_data->app_tx_data_len = off + *len; svm_fifo_peek (f, off, *len, dst); - - return 0; } static const quicly_stream_callbacks_t quic_stream_callbacks = { |