From a37b0c967c44fc3530505c716f5218af0b7ef68d Mon Sep 17 00:00:00 2001 From: Dmitri Tikhonov Date: Mon, 10 Dec 2018 22:40:01 -0500 Subject: [PATCH] Release 1.17.8 [BUGFIX] Fix compilation on FreeBSD and 32-bit Linux --- CHANGELOG | 4 ++++ include/lsquic.h | 2 +- src/liblsquic/lsquic_engine.c | 11 ----------- src/liblsquic/lsquic_engine_public.h | 2 -- src/liblsquic/lsquic_parse_iquic_common.c | 4 ++-- src/liblsquic/lsquic_version.c | 23 ----------------------- src/liblsquic/lsquic_version.h | 3 --- test/http_client.c | 1 + 8 files changed, 8 insertions(+), 42 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 732e277..5057980 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2018-12-10 + - 1.17.8 + - [BUGFIX] Fix compilation on FreeBSD and 32-bit Linux + 2018-12-03 - 1.17.7 - [BUGFIX] Do not unset PING alarm before ringing expired alarms. diff --git a/include/lsquic.h b/include/lsquic.h index 7c1fde5..01d11cc 100644 --- a/include/lsquic.h +++ b/include/lsquic.h @@ -25,7 +25,7 @@ extern "C" { #define LSQUIC_MAJOR_VERSION 1 #define LSQUIC_MINOR_VERSION 17 -#define LSQUIC_PATCH_VERSION 7 +#define LSQUIC_PATCH_VERSION 8 /** * Engine flags: diff --git a/src/liblsquic/lsquic_engine.c b/src/liblsquic/lsquic_engine.c index a53ac3c..d7bddb8 100644 --- a/src/liblsquic/lsquic_engine.c +++ b/src/liblsquic/lsquic_engine.c @@ -284,7 +284,6 @@ lsquic_engine_new (unsigned flags, const struct lsquic_engine_api *api) { lsquic_engine_t *engine; - int tag_buf_len; char err_buf[100]; if (!api->ea_packets_out) @@ -313,16 +312,6 @@ lsquic_engine_new (unsigned flags, engine->pub.enp_settings = *api->ea_settings; else lsquic_engine_init_settings(&engine->pub.enp_settings, flags); - tag_buf_len = lsquic_gen_ver_tags(engine->pub.enp_ver_tags_buf, - sizeof(engine->pub.enp_ver_tags_buf), - engine->pub.enp_settings.es_versions); - if (tag_buf_len <= 0) - { - LSQ_ERROR("cannot generate version tags buffer"); - free(engine); - return NULL; - } - engine->pub.enp_ver_tags_len = tag_buf_len; engine->pub.enp_flags = ENPUB_CAN_SEND; engine->flags = flags; diff --git a/src/liblsquic/lsquic_engine_public.h b/src/liblsquic/lsquic_engine_public.h index e9badd1..4c9697b 100644 --- a/src/liblsquic/lsquic_engine_public.h +++ b/src/liblsquic/lsquic_engine_public.h @@ -29,8 +29,6 @@ struct lsquic_engine_public { */ ENPUB_CAN_SEND = (1 << 1), } enp_flags; - unsigned char enp_ver_tags_buf[ sizeof(lsquic_ver_tag_t) * N_LSQVER ]; - unsigned enp_ver_tags_len; }; /* Put connection onto the Tickable Queue if it is not already on it. If diff --git a/src/liblsquic/lsquic_parse_iquic_common.c b/src/liblsquic/lsquic_parse_iquic_common.c index 72986c5..273b87e 100644 --- a/src/liblsquic/lsquic_parse_iquic_common.c +++ b/src/liblsquic/lsquic_parse_iquic_common.c @@ -93,7 +93,7 @@ lsquic_iquic_parse_packet_in_long_begin (lsquic_packet_in_t *packet_in, * the packet number field and the version tag are the same. The check * will probably have to be split in the future. */ - if (end - p < dcil + scil + packet_len) + if (end - p < (ptrdiff_t) (dcil + scil + packet_len)) return -1; memcpy(&packet_in->pi_conn_id, p, cid_len); @@ -150,7 +150,7 @@ lsquic_iquic_parse_packet_in_short_begin (lsquic_packet_in_t *packet_in, return -1; packet_len = 1 << (*p & 3); - if (pend - p < 1 + cid_len + packet_len) + if (pend - p < (ptrdiff_t) (1 + cid_len + packet_len)) return -1; ++p; diff --git a/src/liblsquic/lsquic_version.c b/src/liblsquic/lsquic_version.c index 26c3fca..d6eecf5 100644 --- a/src/liblsquic/lsquic_version.c +++ b/src/liblsquic/lsquic_version.c @@ -69,26 +69,3 @@ const char *const lsquic_ver2str[N_LSQVER] = { }; -int -lsquic_gen_ver_tags (unsigned char *buf, size_t bufsz, unsigned version_bitmask) -{ - unsigned n; - lsquic_ver_tag_t tag; - unsigned char *p = buf; - unsigned char *const pend = p + bufsz; - for (n = 0; version_bitmask; ++n) - { - if (version_bitmask & (1 << n)) - { - if (p + 4 > pend) - return -1; - version_bitmask &= ~(1 << n); - tag = lsquic_ver2tag(n); - if (0 == tag) - return -1; - memcpy(p, &tag, 4); - p += 4; - } - } - return p - buf; -} diff --git a/src/liblsquic/lsquic_version.h b/src/liblsquic/lsquic_version.h index 5ea7c38..6f99d26 100644 --- a/src/liblsquic/lsquic_version.h +++ b/src/liblsquic/lsquic_version.h @@ -16,7 +16,4 @@ lsquic_tag2ver (uint32_t ver_tag); extern const char *const lsquic_ver2str[]; -int -lsquic_gen_ver_tags (unsigned char *buf, size_t bufsz, unsigned versions); - #endif diff --git a/test/http_client.c b/test/http_client.c index 738c90f..f694b71 100644 --- a/test/http_client.c +++ b/test/http_client.c @@ -26,6 +26,7 @@ #include #include #include +#include #endif #include #include