The reference says:

   If the ACK flag was set then send:
       <SN=received AN><CTL=RST>
   If the ACK flag was not set then send:
       <SN=0><AN=received SN+1 modulo 2><CTL=RST, ACK>
   (i.e. in both cases RST is needed)

The RST flag is set initially in the 'control' variable; so instead of
completely overwriting it, make sure the additional flags are OR-ed
to the current value.

Signed-off-by: Aleksander Morgado <aleksan...@aleksander.es>
---
 lib/ratp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ratp.c b/lib/ratp.c
index a8ac52c75..43b8b04dc 100644
--- a/lib/ratp.c
+++ b/lib/ratp.c
@@ -1038,7 +1038,7 @@ static int ratp_behaviour_g(struct ratp_internal *ri, 
void *pkt)
        if (hdr->control & RATP_CONTROL_ACK)
                control |= ratp_set_sn(ratp_an(hdr));
        else
-               control = ratp_set_an(ratp_sn(hdr) + 1) | RATP_CONTROL_ACK;
+               control |= ratp_set_an(ratp_sn(hdr) + 1) | RATP_CONTROL_ACK;
 
        ratp_send_hdr(ri, control);
 
-- 
2.13.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to