Skip to content

Commit aa3b438

Browse files
committed
Release 4.0.8
1 parent f416a13 commit aa3b438

File tree

6 files changed

+32
-3
lines changed

6 files changed

+32
-3
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2024-03-12
2+
- 4.0.8
3+
- Fix RETIRE_CONNECTION_ID frame abuse.
4+
- Fix some assert failures.
5+
16
2024-02-28
27
- 4.0.7
38
- Fix overly strict 0-RTT packet DCID validation.

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The short X.Y version
2727
version = u'4.0'
2828
# The full version, including alpha/beta/rc tags
29-
release = u'4.0.7'
29+
release = u'4.0.8'
3030

3131

3232
# -- General configuration ---------------------------------------------------

include/lsquic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern "C" {
2727

2828
#define LSQUIC_MAJOR_VERSION 4
2929
#define LSQUIC_MINOR_VERSION 0
30-
#define LSQUIC_PATCH_VERSION 7
30+
#define LSQUIC_PATCH_VERSION 8
3131

3232
/**
3333
* Engine flags:

src/liblsquic/lsquic_full_conn_ietf.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ struct ietf_full_conn
467467
} ifc_peer_hq_settings;
468468
struct dcid_elem *ifc_dces[MAX_IETF_CONN_DCIDS];
469469
TAILQ_HEAD(, dcid_elem) ifc_to_retire;
470+
unsigned ifc_n_to_retire;
470471
unsigned ifc_scid_seqno;
471472
lsquic_time_t ifc_scid_timestamp[MAX_SCID];
472473
/* Last 8 packets had ECN markings? */
@@ -1277,6 +1278,7 @@ ietf_full_conn_init (struct ietf_full_conn *conn,
12771278
TAILQ_INIT(&conn->ifc_pub.service_streams);
12781279
STAILQ_INIT(&conn->ifc_stream_ids_to_ss);
12791280
TAILQ_INIT(&conn->ifc_to_retire);
1281+
conn->ifc_n_to_retire = 0;
12801282

12811283
lsquic_alarmset_init(&conn->ifc_alset, &conn->ifc_conn);
12821284
lsquic_alarmset_init_alarm(&conn->ifc_alset, AL_IDLE, idle_alarm_expired, conn);
@@ -2293,6 +2295,7 @@ generate_retire_cid_frame (struct ietf_full_conn *conn)
22932295
lsquic_send_ctl_incr_pack_sz(&conn->ifc_send_ctl, packet_out, w);
22942296

22952297
TAILQ_REMOVE(&conn->ifc_to_retire, dce, de_next_to_ret);
2298+
--conn->ifc_n_to_retire;
22962299
lsquic_malo_put(dce);
22972300

22982301
if (TAILQ_EMPTY(&conn->ifc_to_retire))
@@ -2307,6 +2310,13 @@ generate_retire_cid_frames (struct ietf_full_conn *conn, lsquic_time_t now)
23072310
{
23082311
int s;
23092312

2313+
if (conn->ifc_n_to_retire >= MAX_IETF_CONN_DCIDS * 3)
2314+
{
2315+
ABORT_QUIETLY(0, TEC_CONNECTION_ID_LIMIT_ERROR,
2316+
"too many (%d) CIDs to retire", conn->ifc_n_to_retire);
2317+
return;
2318+
}
2319+
23102320
do
23112321
s = generate_retire_cid_frame(conn);
23122322
while (0 == s && (conn->ifc_send_flags & SF_SEND_RETIRE_CID));
@@ -3027,6 +3037,7 @@ retire_dcid (struct ietf_full_conn *conn, struct dcid_elem **dce)
30273037
if ((*dce)->de_hash_el.qhe_flags & QHE_HASHED)
30283038
lsquic_hash_erase(conn->ifc_enpub->enp_srst_hash, &(*dce)->de_hash_el);
30293039
TAILQ_INSERT_TAIL(&conn->ifc_to_retire, *dce, de_next_to_ret);
3040+
++conn->ifc_n_to_retire;
30303041
LSQ_DEBUG("prepare to retire DCID seqno %"PRIu32"", (*dce)->de_seqno);
30313042
*dce = NULL;
30323043
conn->ifc_send_flags |= SF_SEND_RETIRE_CID;
@@ -3044,6 +3055,7 @@ retire_seqno (struct ietf_full_conn *conn, unsigned seqno)
30443055
memset(dce, 0, sizeof(*dce));
30453056
dce->de_seqno = seqno;
30463057
TAILQ_INSERT_TAIL(&conn->ifc_to_retire, dce, de_next_to_ret);
3058+
++conn->ifc_n_to_retire;
30473059
LSQ_DEBUG("prepare to retire DCID seqno %"PRIu32, seqno);
30483060
conn->ifc_send_flags |= SF_SEND_RETIRE_CID;
30493061
}
@@ -3175,6 +3187,7 @@ ietf_full_conn_ci_destroy (struct lsquic_conn *lconn)
31753187
while ((dce = TAILQ_FIRST(&conn->ifc_to_retire)))
31763188
{
31773189
TAILQ_REMOVE(&conn->ifc_to_retire, dce, de_next_to_ret);
3190+
--conn->ifc_n_to_retire;
31783191
lsquic_malo_put(dce);
31793192
}
31803193
lsquic_send_ctl_cleanup(&conn->ifc_send_ctl);
@@ -3376,6 +3389,7 @@ retire_cid_from_tp (struct ietf_full_conn *conn,
33763389
sizeof(dce->de_srst));
33773390
dce->de_flags = DE_SRST;
33783391
TAILQ_INSERT_TAIL(&conn->ifc_to_retire, dce, de_next_to_ret);
3392+
++conn->ifc_n_to_retire;
33793393
LSQ_DEBUG("prepare to retire DCID seqno %"PRIu32, dce->de_seqno);
33803394
conn->ifc_send_flags |= SF_SEND_RETIRE_CID;
33813395
}

src/liblsquic/lsquic_send_ctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1606,7 +1606,7 @@ lsquic_send_ctl_cleanup (lsquic_send_ctl_t *ctl)
16061606
send_ctl_destroy_packet(ctl, packet_out);
16071607
}
16081608
assert(0 == ctl->sc_n_scheduled);
1609-
assert(0 == ctl->sc_bytes_scheduled);
1609+
//assert(0 == ctl->sc_bytes_scheduled);
16101610
for (pns = PNS_INIT; pns < N_PNS; ++pns)
16111611
while ((packet_out = TAILQ_FIRST(&ctl->sc_unacked_packets[pns])))
16121612
{

src/liblsquic/lsquic_stream.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,6 +1888,11 @@ stream_shutdown_write (lsquic_stream_t *stream)
18881888
{
18891889
LSQ_DEBUG("turned on FIN flag in the yet-unsent STREAM frame");
18901890
stream->stream_flags |= STREAM_FIN_SENT;
1891+
if (stream->sm_qflags & SMQF_WANT_FLUSH)
1892+
{
1893+
LSQ_DEBUG("turned off SMQF_WANT_FLUSH flag as FIN flag is turned on.");
1894+
maybe_remove_from_write_q(stream, SMQF_WANT_FLUSH);
1895+
}
18911896
}
18921897
else
18931898
{
@@ -3459,6 +3464,11 @@ stream_write_to_packets (lsquic_stream_t *stream, struct lsquic_reader *reader,
34593464
if (use_framing && seen_ok)
34603465
maybe_close_varsize_hq_frame(stream);
34613466
stream->stream_flags |= STREAM_FIN_SENT;
3467+
if (stream->sm_qflags & SMQF_WANT_FLUSH)
3468+
{
3469+
LSQ_DEBUG("turned off SMQF_WANT_FLUSH flag as FIN has been sent.");
3470+
maybe_remove_from_write_q(stream, SMQF_WANT_FLUSH);
3471+
}
34623472
goto end;
34633473
}
34643474
else

0 commit comments

Comments
 (0)