mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] ratp: Fix closing connections
@ 2020-06-16  9:29 Sascha Hauer
  2020-06-16  9:29 ` [PATCH 2/2] ratp: Straighten ratp deregistration Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2020-06-16  9:29 UTC (permalink / raw)
  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 <s.hauer@pengutronix.de>
---
 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-16  9:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16  9:29 [PATCH 1/2] ratp: Fix closing connections Sascha Hauer
2020-06-16  9:29 ` [PATCH 2/2] ratp: Straighten ratp deregistration Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox