summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--networking/tftp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/networking/tftp.c b/networking/tftp.c
index a3808f5bf..378ba2fef 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -279,8 +279,6 @@ static inline int tftp(const int cmd, const struct hostent *host,
}
cp += len;
- } else if (finished) {
- break;
}
}
@@ -306,8 +304,11 @@ static inline int tftp(const int cmd, const struct hostent *host,
}
- /* receive packet */
+ if (finished) {
+ break;
+ }
+ /* receive packet */
memset(&from, 0, sizeof(from));
fromlen = sizeof(from);
@@ -359,7 +360,7 @@ static inline int tftp(const int cmd, const struct hostent *host,
} while (timeout && (len >= 0));
- if (len < 0) {
+ if ((finished) || (len < 0)) {
break;
}