summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2017-06-21 21:13:18 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-06-23 13:34:07 +0200
commit9adcfb5c5318a4735511840883f6f4cd52e62699 (patch)
tree575c96ec8df598f716e119a559114a42ef34ca5b
parente03f80b26ce527d2fc262ca09bd16f55f3d3df20 (diff)
downloadbarebox-9adcfb5c5318a4735511840883f6f4cd52e62699.tar.gz
barebox-9adcfb5c5318a4735511840883f6f4cd52e62699.tar.xz
ratp: consolidate ratp_sn_expected() and ratp_an_expected()
This is no code change in ratp_sn_expected(), it's just rewritten in the same way as ratp_an_expected(), which follows the RFC916 approach. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--lib/ratp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ratp.c b/lib/ratp.c
index 5c52d3b5f6..46a2b645c9 100644
--- a/lib/ratp.c
+++ b/lib/ratp.c
@@ -359,7 +359,7 @@ static bool ratp_an_expected(struct ratp_internal *ri, struct ratp_header *hdr)
static bool ratp_sn_expected(struct ratp_internal *ri, struct ratp_header *hdr)
{
- return ratp_sn(hdr) != ri->sn_received;
+ return ratp_sn(hdr) == (ri->sn_received + 1) % 2;
}
static int ratp_send_ack(struct ratp_internal *ri, struct ratp_header *hdr)