[PATCH 04/16] ratp: add missing RST flag in behavior G

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <aleksander@xxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux