summaryrefslogtreecommitdiffstats
path: root/lib/ratp.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2017-06-21 21:13:23 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-06-23 13:34:07 +0200
commit5bde92c92b0efb675969d09386667f110f63cd6c (patch)
tree9a1f604dc5f7b2ce94fc9ef73f2a8a88cda8cf97 /lib/ratp.c
parent22da8b1c90297256b6003d178066d51bdada37a8 (diff)
downloadbarebox-5bde92c92b0efb675969d09386667f110f63cd6c.tar.gz
barebox-5bde92c92b0efb675969d09386667f110f63cd6c.tar.xz
ratp: user close may happen in SYN-RECEIVED state
The reference says: 5.2.3. SYN-RECEIVED ... Departures - A CLOSE request is made by the user. Create a packet with FIN set. Send it and go to the FIN-WAIT state. Add this missing step. Probably not a real usecase for barebox anyway as there is no user triggered close. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib/ratp.c')
-rw-r--r--lib/ratp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ratp.c b/lib/ratp.c
index 46a82c69ae..e7fbf640a7 100644
--- a/lib/ratp.c
+++ b/lib/ratp.c
@@ -1689,7 +1689,7 @@ void ratp_close(struct ratp *ratp)
if (!ri)
return;
- if (ri->state == RATP_STATE_ESTABLISHED) {
+ if (ri->state == RATP_STATE_ESTABLISHED || ri->state == RATP_STATE_SYN_RECEIVED) {
uint64_t start;
u8 control;