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 <[email protected]>
---
 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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to