summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorgavin <gavin@FreeBSD.org>2010-01-17 10:58:59 +0000
committergavin <gavin@FreeBSD.org>2010-01-17 10:58:59 +0000
commit0bd93a7ab7f1c476a1595df7f5e32849c93a0bd6 (patch)
tree25b72817197740309fd1355197922a52423ac366 /usr.bin
parentf05781a9ad213438e6580e67b5a3a28b65343dd9 (diff)
downloadFreeBSD-src-0bd93a7ab7f1c476a1595df7f5e32849c93a0bd6.zip
FreeBSD-src-0bd93a7ab7f1c476a1595df7f5e32849c93a0bd6.tar.gz
Merge r201429:
Fix return code in the case of successful file transfer, broken in tftp.c 1.13 PR: bin/117452 Submitted by: Spencer Minear minear securecomputing.com Approved by: ed (mentor, implicit)
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tftp/tftp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/tftp/tftp.c b/usr.bin/tftp/tftp.c
index 2f032df..4300902 100644
--- a/usr.bin/tftp/tftp.c
+++ b/usr.bin/tftp/tftp.c
@@ -140,6 +140,7 @@ send_data:
(struct sockaddr *)&peer, peer.ss_len);
if (n != size + 4) {
warn("sendto");
+ txrx_error = 1;
goto abort;
}
read_ahead(file, convert);
@@ -153,6 +154,7 @@ send_data:
alarm(0);
if (n < 0) {
warn("recvfrom");
+ txrx_error = 1;
goto abort;
}
if (!serv.ss_family)
@@ -160,6 +162,7 @@ send_data:
else if (!cmpport((struct sockaddr *)&serv,
(struct sockaddr *)&from)) {
warn("server port mismatch");
+ txrx_error = 1;
goto abort;
}
peer = from;
@@ -202,7 +205,6 @@ abort:
stopclock();
if (amount > 0)
printstats("Sent", amount);
- txrx_error = 1;
}
/*
@@ -255,6 +257,7 @@ send_ack:
peer.ss_len) != size) {
alarm(0);
warn("sendto");
+ txrx_error = 1;
goto abort;
}
write_behind(file, convert);
@@ -268,6 +271,7 @@ send_ack:
alarm(0);
if (n < 0) {
warn("recvfrom");
+ txrx_error = 1;
goto abort;
}
if (!serv.ss_family)
@@ -275,6 +279,7 @@ send_ack:
else if (!cmpport((struct sockaddr *)&serv,
(struct sockaddr *)&from)) {
warn("server port mismatch");
+ txrx_error = 1;
goto abort;
}
peer = from;
@@ -325,7 +330,6 @@ abort: /* ok to ack, since user */
stopclock();
if (amount > 0)
printstats("Received", amount);
- txrx_error = 1;
}
static int
OpenPOWER on IntegriCloud