From e4202fe9a6d2be71523c8fdb7fdfc003b423d7e6 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 18 May 2020 20:34:54 +0200 Subject: [PATCH] Don't start RTT measurements for unreliable channels. We are not getting ACKs back, and the RTT value is not used for unreliable channels anyway. --- src/utcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utcp.c b/src/utcp.c index f81150bf..dc5a2fcf 100644 --- a/src/utcp.c +++ b/src/utcp.c @@ -719,7 +719,7 @@ static void ack(struct utcp_connection *c, bool sendatleastone) { pkt->hdr.ctl |= FIN; } - if(!c->rtt_start.tv_sec) { + if(!c->rtt_start.tv_sec && is_reliable(c)) { // Start RTT measurement clock_gettime(UTCP_CLOCK, &c->rtt_start); c->rtt_seq = pkt->hdr.seq + seglen; -- 2.39.5