summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Vlasov2008-07-30 21:27:09 +0200
committerMichael Brown2008-07-30 21:27:09 +0200
commite6cd16946a2c52f39d3ea308ab1fb80a85c9d0a3 (patch)
treec22c9ece59c7283954459e7428d0a380b85a17d4
parent[ftp] Cope with RETR completion prior to all data received (diff)
downloadipxe-e6cd16946a2c52f39d3ea308ab1fb80a85c9d0a3.tar.gz
ipxe-e6cd16946a2c52f39d3ea308ab1fb80a85c9d0a3.tar.xz
ipxe-e6cd16946a2c52f39d3ea308ab1fb80a85c9d0a3.zip
[ftp] Terminate processing after receiving an error
When an error reply (not 1xx, 2xx or 3xx) was received, ftp_reply() invoked ftp_done() to close connections, but did not return, and the rest of code in this function could try to send commands to the closed control connection. Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
-rw-r--r--src/net/tcp/ftp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/net/tcp/ftp.c b/src/net/tcp/ftp.c
index 9a12064e..3b88f7b6 100644
--- a/src/net/tcp/ftp.c
+++ b/src/net/tcp/ftp.c
@@ -221,6 +221,7 @@ static void ftp_reply ( struct ftp_request *ftp ) {
( ( status_major == '3' ) && ( ftp->state == FTP_USER ) ) ) ){
/* Flag protocol error and close connections */
ftp_done ( ftp, -EPROTO );
+ return;
}
/* Open passive connection when we get "PASV" response */