diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2017-06-21 21:13:11 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-06-23 13:34:07 +0200 |
commit | f86ab0b1317ae1373f89edef945a63f564d06538 (patch) | |
tree | fb0751eb7635db5bd4011f70a4180067df18ccf8 | |
parent | bdafe8150dddcde945170dfdb268542a128ea038 (diff) | |
download | barebox-f86ab0b1317ae1373f89edef945a63f564d06538.tar.gz barebox-f86ab0b1317ae1373f89edef945a63f564d06538.tar.xz |
ratp: add missing RST flag in behavior G
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.
This fix isn't related to any failed barebox<->bbremote interaction
(it really is a very rare corner case).
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | lib/ratp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ratp.c b/lib/ratp.c index a8ac52c75f..43b8b04dc7 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); |