Release 2.29.0

- [FEATURE] QUIC and HTTP/3 Internet Draft 34 support and v1 support.
  The latter is turned off by default.
- Drop support for ID-28 and ID-32.
- [BUGFIX] IETF QUIC mini conn receive history (trechist): allow
  unlimited inserts by dropping smallest elements.
- [BUGFIX] gQUIC: set STTL to correct value, issue #226.
- [BUGFIX] Account for poison packet gap when MTU probe was too large.
This commit is contained in:
Dmitri Tikhonov 2021-02-10 08:51:11 -05:00
parent ac0ce07bd0
commit 26e8f082c9
29 changed files with 411 additions and 178 deletions

View file

@ -1141,9 +1141,9 @@ fuzz_guided_pwritev_testing (const char *input)
case 1: version = LSQVER_046; break;
case 2: version = LSQVER_050; break;
case 3: version = LSQVER_ID27; break;
case 4: version = LSQVER_ID28; break;
case 4: version = LSQVER_ID29; break;
default:
case 5: version = LSQVER_ID29; break;
case 5: version = LSQVER_ID34; break;
}
sched_immed = !!(buf[8] & 0x08);

View file

@ -16,6 +16,32 @@
#include "lsquic_trechist.h"
struct str_range_iter
{
char *str;
struct lsquic_packno_range range;
};
static const struct lsquic_packno_range *
next_str_range (void *ctx)
{
struct str_range_iter *const str_iter = ctx;
if (str_iter->str && str_iter->str[0] == '[')
{
str_iter->range.high = strtoul(str_iter->str + 1, &str_iter->str, 10);
assert('-' == *str_iter->str);
str_iter->range.low = strtoul(str_iter->str + 1, &str_iter->str, 10);
assert(']' == *str_iter->str);
++str_iter->str;
return &str_iter->range;
}
else
return NULL;
}
static void
test_clone (trechist_mask_t src_mask, struct trechist_elem *src_elems)
{
@ -23,14 +49,12 @@ test_clone (trechist_mask_t src_mask, struct trechist_elem *src_elems)
struct trechist_elem *hist_elems;
const struct lsquic_packno_range *ranges[2];
struct trechist_iter iters[2];
int s;
hist_elems = malloc(sizeof(hist_elems[0]) * TRECHIST_MAX_RANGES);
lsquic_trechist_iter(&iters[0], src_mask, src_elems);
s = lsquic_trechist_copy_ranges(&hist_mask, hist_elems, &iters[0],
lsquic_trechist_copy_ranges(&hist_mask, hist_elems, &iters[0],
lsquic_trechist_first, lsquic_trechist_next);
assert(s == 0);
lsquic_trechist_iter(&iters[0], src_mask, src_elems);
lsquic_trechist_iter(&iters[1], hist_mask, hist_elems);
@ -254,10 +278,6 @@ basic_test (void)
s = lsquic_trechist_insert(&hist_mask, hist_elems, 1);
assert(("inserting packet number one is successful", 0 == s));
s = lsquic_trechist_insert(&hist_mask, hist_elems, 1);
assert(("inserting packet number one again results in duplicate error",
s == 1));
lsquic_trechist_iter(&iter, hist_mask, hist_elems);
range = lsquic_trechist_first(&iter);
assert(("first range returned correctly", range));
@ -338,18 +358,168 @@ test_limits (void)
s = lsquic_trechist_insert(&hist_mask, hist_elems, i);
assert(s == -1); /* Overflow */
for (i = 0; i < TRECHIST_MAX_RANGES - 1; ++i)
/* Always successful inserting new entries: */
for (i = 0; i < TRECHIST_MAX_RANGES * 2; ++i)
{
s = lsquic_trechist_insert(&hist_mask, hist_elems, 1000 + 2 * i);
assert(s == 0);
}
s = lsquic_trechist_insert(&hist_mask, hist_elems, 1000 + 2 * i);
assert(s == -1); /* Out of ranges */
/* Always successful inserting new entries in descending order, too: */
for (i = 0; i < TRECHIST_MAX_RANGES * 2; ++i)
{
s = lsquic_trechist_insert(&hist_mask, hist_elems, 10000 - 2 * i);
assert(s == 0);
}
/* Test merge where count exceeds max: */
hist_mask = 0;
lsquic_trechist_copy_ranges(&hist_mask, hist_elems,
& (struct str_range_iter) { .str = "[400-202][200-1]", },
next_str_range, next_str_range);
s = lsquic_trechist_insert(&hist_mask, hist_elems, 201);
assert(s == -1);
free(hist_elems);
}
static void
test_overflow (void)
{
trechist_mask_t mask;
struct trechist_elem *elems;
int s;
char buf[0x1000];
struct str_range_iter str_iter = { .str =
"[395-390]" /* 1 */
"[385-380]"
"[375-370]"
"[365-360]"
"[355-350]" /* 5 */
"[345-340]"
"[335-330]"
"[325-320]"
"[315-310]"
"[305-300]" /* 10 */
"[295-290]"
"[285-280]"
"[275-270]"
"[265-260]"
"[255-250]" /* 15 */
"[245-240]" /* 16 */
"[235-230]" /* Overflow vvvvvv */
"[225-220]"
"[215-210]"
"[205-200]"
"[195-190]"
"[185-180]" };
elems = malloc(sizeof(elems[0]) * TRECHIST_MAX_RANGES);
lsquic_trechist_copy_ranges(&mask, elems, &str_iter, next_str_range,
next_str_range);
rechist2str(mask, elems, buf, sizeof(buf));
assert(0 == strcmp(buf,
"[395-390]" /* 1 */
"[385-380]"
"[375-370]"
"[365-360]"
"[355-350]" /* 5 */
"[345-340]"
"[335-330]"
"[325-320]"
"[315-310]"
"[305-300]" /* 10 */
"[295-290]"
"[285-280]"
"[275-270]"
"[265-260]"
"[255-250]" /* 15 */
"[245-240]" /* 16 */));
s = lsquic_trechist_insert(&mask, elems, 400);
assert(s == 0);
rechist2str(mask, elems, buf, sizeof(buf));
assert(0 == strcmp(buf,
"[400-400]"
"[395-390]"
"[385-380]"
"[375-370]"
"[365-360]"
"[355-350]"
"[345-340]"
"[335-330]"
"[325-320]"
"[315-310]"
"[305-300]"
"[295-290]"
"[285-280]"
"[275-270]"
"[265-260]"
"[255-250]"
));
/* One more for a good measure */
s = lsquic_trechist_insert(&mask, elems, 402);
assert(s == 0);
rechist2str(mask, elems, buf, sizeof(buf));
assert(0 == strcmp(buf,
"[402-402]"
"[400-400]"
"[395-390]"
"[385-380]"
"[375-370]"
"[365-360]"
"[355-350]"
"[345-340]"
"[335-330]"
"[325-320]"
"[315-310]"
"[305-300]"
"[295-290]"
"[285-280]"
"[275-270]"
"[265-260]"
));
s = lsquic_trechist_insert(&mask, elems, 401);
assert(s == 0);
s = lsquic_trechist_insert(&mask, elems, 500);
assert(s == 0);
s = lsquic_trechist_insert(&mask, elems, 200);
assert(s == 0);
s = lsquic_trechist_insert(&mask, elems, 267);
assert(s == 0);
/* One more for a good measure */
s = lsquic_trechist_insert(&mask, elems, 402);
assert(s == 0);
rechist2str(mask, elems, buf, sizeof(buf));
assert(0 == strcmp(buf,
"[500-500]"
"[402-400]"
"[395-390]"
"[385-380]"
"[375-370]"
"[365-360]"
"[355-350]"
"[345-340]"
"[335-330]"
"[325-320]"
"[315-310]"
"[305-300]"
"[295-290]"
"[285-280]"
"[275-270]"
"[267-267]"
));
free(elems);
}
int
main (void)
{
@ -357,6 +527,7 @@ main (void)
test4();
test5();
test_limits();
test_overflow();
return 0;
}