mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 1/2] ratp: Fix closing connections
Date: Tue, 16 Jun 2020 11:29:05 +0200	[thread overview]
Message-ID: <20200616092906.2626-1-s.hauer@pengutronix.de> (raw)

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

             reply	other threads:[~2020-06-16  9:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16  9:29 Sascha Hauer [this message]
2020-06-16  9:29 ` [PATCH 2/2] ratp: Straighten ratp deregistration Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200616092906.2626-1-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox