From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jl7u9-0002QV-56 for barebox@lists.infradead.org; Tue, 16 Jun 2020 09:29:18 +0000 From: Sascha Hauer Date: Tue, 16 Jun 2020 11:29:05 +0200 Message-Id: <20200616092906.2626-1-s.hauer@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 1/2] ratp: Fix closing connections To: Barebox List When entering the LAST_ACK state we have to set the saved SN to the received SN of the current packet. With this we properly accept the final incoming packet and close the connection. Without this we interpret the final incoming packet as a duplicate of the previous packet and close the connection only after a timeout. Signed-off-by: Sascha Hauer --- lib/ratp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ratp.c b/lib/ratp.c index 1901cc8ea8..ce30223bac 100644 --- a/lib/ratp.c +++ b/lib/ratp.c @@ -1109,6 +1109,8 @@ static int ratp_behaviour_h2(struct ratp_internal *ri, void *pkt) ratp_state_change(ri, RATP_STATE_LAST_ACK); + ri->sn_received = ratp_sn(hdr); + return 1; } -- 2.27.0 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox