File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3110,7 +3110,10 @@ static void tcp_ack(struct tsocket *t, const struct wolfIP_tcp_seg *tcp)
31103110 ack_frame_len = ETH_HEADER_LEN + ack_ip_len ;
31113111 /* Prefer timestamp-based RTT sample from the incoming ACK. */
31123112 if (ack_frame_len == 0 || tcp_process_ts (t , tcp , ack_frame_len ) < 0 ) {
3113- /* No usable TS echo; use coarse RTT sample from send timestamp. */
3113+ /* No usable TS echo; use coarse RTT sample from send timestamp.
3114+ * time_sent is stored modulo 2^32, so this subtraction remains
3115+ * correct across a single tick wrap as long as the RTT sample
3116+ * itself fits in 32 bits. */
31143117 if (t -> S -> last_tick >= fresh_desc -> time_sent ) {
31153118 uint32_t rtt = (uint32_t )(t -> S -> last_tick - fresh_desc -> time_sent );
31163119 tcp_rto_update_from_sample (t , rtt );
You can’t perform that action at this time.
0 commit comments