Skip to content

Commit

Permalink
Release 2.24.2
Browse files Browse the repository at this point in the history
- [BUGFIX] Allow peer to migrate when its SCID is zero-length.
- [BUGFIX] PADDING size calculation: only one Short packet can be
  coalesced.  (This should have been part of the fix in 2.24.1).
- Abort connect if received NEW_CONNECTION_ID but current DCID is
  zero-length.
- Improve log messages
  • Loading branch information
Dmitri Tikhonov committed Nov 5, 2020
1 parent e85d285 commit ee4d393
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 16 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2020-11-05
- 2.24.2
- [BUGFIX] Allow peer to migrate when its SCID is zero-length.
- [BUGFIX] PADDING size calculation: only one Short packet can be
coalesced. (This should have been part of the fix in 2.24.1).
- Abort connect if received NEW_CONNECTION_ID but current DCID is
zero-length.
- Improve log messages

2020-11-04
- 2.24.1
- [API] Allow use of ea_get_ssl_ctx() on the client (optional). PR #186.
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# The short X.Y version
version = u'2.24'
# The full version, including alpha/beta/rc tags
release = u'2.24.1'
release = u'2.24.2'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion include/lsquic.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extern "C" {

#define LSQUIC_MAJOR_VERSION 2
#define LSQUIC_MINOR_VERSION 24
#define LSQUIC_PATCH_VERSION 1
#define LSQUIC_PATCH_VERSION 2

/**
* Engine flags:
Expand Down
5 changes: 5 additions & 0 deletions src/liblsquic/lsquic_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -3026,7 +3026,12 @@ lsquic_engine_packet_in (lsquic_engine_t *engine,
is_ietf = 0 == (packet_in->pi_flags & PI_GQUIC);
packet_in_data += packet_in->pi_data_sz;
if (is_ietf && packet_in_data < packet_end)
{
cid = packet_in->pi_dcid;
if (packet_begin == packet_in->pi_data) /* Only log once: */
LSQ_DEBUGC("received coalesced datagram of %zd bytes for "
"connection %"CID_FMT, packet_in_size, CID_BITS(&cid));
}
packet_in->pi_received = lsquic_time_now();
packet_in->pi_flags |= (3 & ecn) << PIBIT_ECN_SHIFT;
eng_hist_inc(&engine->history, packet_in->pi_received, sl_packets_in);
Expand Down
20 changes: 14 additions & 6 deletions src/liblsquic/lsquic_full_conn_ietf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2101,7 +2101,7 @@ maybe_get_rate_available_scid_slot (struct ietf_full_conn *conn,
return;
}

/* period: ns per cid */
/* period: usec per cid */
period = (60 * 1000000) / conn->ifc_enpub->enp_settings.es_scid_iss_rate;
active_cid = 0;
total_elapsed = 0;
Expand All @@ -2119,12 +2119,12 @@ maybe_get_rate_available_scid_slot (struct ietf_full_conn *conn,
}
}
elapsed_thresh = ((active_cid * (active_cid + 1)) / 2) * period;
/* compare total elapsed ns to elapsed ns threshold */
/* compare total elapsed usec to elapsed usec threshold */
if (total_elapsed < elapsed_thresh)
{
wait_time = (elapsed_thresh - total_elapsed) / active_cid;
LSQ_DEBUG("cid_throt no SCID slots available (rate-limited), "
"must wait %"PRIu64" ns", wait_time);
"must wait %"PRIu64" usec", wait_time);
lsquic_alarmset_set(&conn->ifc_alset, AL_CID_THROT, now + wait_time);
conn->ifc_send_flags &= ~SF_SEND_NEW_CID;
}
Expand Down Expand Up @@ -6067,6 +6067,13 @@ process_new_connection_id_frame (struct ietf_full_conn *conn,
return 0;
}

if (CUR_DCID(conn)->len == 0)
{
ABORT_QUIETLY(0, TEC_PROTOCOL_VIOLATION, "Received NEW_CONNECTION_ID "
"frame, but current DCID is zero-length");
return 0;
}

if (seqno < conn->ifc_last_retire_prior_to)
{
retire_seqno(conn, seqno);
Expand Down Expand Up @@ -6563,10 +6570,11 @@ init_new_path (struct ietf_full_conn *conn, struct conn_path *path,
path->cop_path.np_dcid = dce->de_cid;
dce->de_flags |= DE_ASSIGNED;
}
else if (!dcid_changed)
else if (!dcid_changed || CUR_DCID(conn)->len == 0)
{
/* It is OK to reuse DCID if the peer did not use a new DCID when its
* address changed. See [draft-ietf-quic-transport-24] Section 9.5.
/* It is OK to reuse DCID if it is zero-length or ir the peer did not
* use a new DCID when its address changed. See
* [draft-ietf-quic-transport-24] Section 9.5.
*/
path->cop_path.np_dcid = CUR_NPATH(conn)->np_dcid;
LSQ_DEBUGC("assigned already-used DCID %"CID_FMT" to new path %u, "
Expand Down
2 changes: 2 additions & 0 deletions src/liblsquic/lsquic_send_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1811,6 +1811,8 @@ send_ctl_maybe_zero_pad (struct lsquic_send_ctl *ctl,
if (cum_size + size > limit)
break;
cum_size += size;
if (HETY_NOT_SET == packet_out->po_header_type)
break;
}

LSQ_DEBUG("cum_size: %zu; limit: %zu", cum_size, limit);
Expand Down
16 changes: 8 additions & 8 deletions src/liblsquic/lsquic_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ lsquic_stream_frame_in (lsquic_stream_t *stream, stream_frame_t *frame)
assert(frame->packet_in);

SM_HISTORY_APPEND(stream, SHE_FRAME_IN);
LSQ_DEBUG("received stream frame, offset 0x%"PRIX64", len %u; "
LSQ_DEBUG("received stream frame, offset %"PRIu64", len %u; "
"fin: %d", frame->data_frame.df_offset, frame->data_frame.df_size, !!frame->data_frame.df_fin);

if ((stream->sm_bflags & SMBF_USE_HEADERS)
Expand Down Expand Up @@ -1210,16 +1210,16 @@ lsquic_stream_rst_in (lsquic_stream_t *stream, uint64_t offset,

if (lsquic_sfcw_get_max_recv_off(&stream->fc) > offset)
{
LSQ_INFO("RST_STREAM invalid: its offset 0x%"PRIX64" is "
LSQ_INFO("RST_STREAM invalid: its offset %"PRIu64" is "
"smaller than that of byte following the last byte we have seen: "
"0x%"PRIX64, offset,
"%"PRIu64, offset,
lsquic_sfcw_get_max_recv_off(&stream->fc));
return -1;
}

if (!lsquic_sfcw_set_max_recv_off(&stream->fc, offset))
{
LSQ_INFO("RST_STREAM invalid: its offset 0x%"PRIX64
LSQ_INFO("RST_STREAM invalid: its offset %"PRIu64
" violates flow control", offset);
return -1;
}
Expand Down Expand Up @@ -4142,13 +4142,13 @@ lsquic_stream_window_update (lsquic_stream_t *stream, uint64_t offset)
if (offset > stream->max_send_off)
{
SM_HISTORY_APPEND(stream, SHE_WINDOW_UPDATE);
LSQ_DEBUG("update max send offset from 0x%"PRIX64" to "
"0x%"PRIX64, stream->max_send_off, offset);
LSQ_DEBUG("update max send offset from %"PRIu64" to "
"%"PRIu64, stream->max_send_off, offset);
stream->max_send_off = offset;
}
else
LSQ_DEBUG("new offset 0x%"PRIX64" is not larger than old "
"max send offset 0x%"PRIX64", ignoring", offset,
LSQ_DEBUG("new offset %"PRIu64" is not larger than old "
"max send offset %"PRIu64", ignoring", offset,
stream->max_send_off);
}

Expand Down

0 comments on commit ee4d393

Please sign in to comment.