Release 1.17.8

[BUGFIX] Fix compilation on FreeBSD and 32-bit Linux
This commit is contained in:
Dmitri Tikhonov 2018-12-10 22:40:01 -05:00
parent 18237fa49c
commit a37b0c967c
8 changed files with 8 additions and 42 deletions

View File

@ -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.

View File

@ -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:

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;
}

View File

@ -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

View File

@ -26,6 +26,7 @@
#include <unistd.h>
#include <sys/types.h>
#include <dirent.h>
#include <limits.h>
#endif
#include <sys/stat.h>
#include <fcntl.h>