summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-06-15 16:00:36 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-06-16 10:49:22 +0200
commitc90ff1bdfbbc46826101c75d36903d798822c805 (patch)
tree2b37c5f190f7be625c1df262cd6e85e1cdddcb34
parent6c1e7688df94a9d4dfebeb62266f7fc91c209d8a (diff)
downloadbarebox-c90ff1bdfbbc46826101c75d36903d798822c805.tar.gz
barebox-c90ff1bdfbbc46826101c75d36903d798822c805.tar.xz
ratp: Fix closing connections
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>
-rw-r--r--lib/ratp.c2
1 files changed, 2 insertions, 0 deletions
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;
}