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)
This commit is contained in:
Gavin Atkinson 2010-01-17 10:58:59 +00:00
parent d077836245
commit 322a943070
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/8/; revision=202462

View File

@ -140,6 +140,7 @@ xmitfile(int fd, const char *name, const char *mode)
(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 @@ xmitfile(int fd, const char *name, const char *mode)
alarm(0);
if (n < 0) {
warn("recvfrom");
txrx_error = 1;
goto abort;
}
if (!serv.ss_family)
@ -160,6 +162,7 @@ xmitfile(int fd, const char *name, const char *mode)
else if (!cmpport((struct sockaddr *)&serv,
(struct sockaddr *)&from)) {
warn("server port mismatch");
txrx_error = 1;
goto abort;
}
peer = from;
@ -202,7 +205,6 @@ xmitfile(int fd, const char *name, const char *mode)
stopclock();
if (amount > 0)
printstats("Sent", amount);
txrx_error = 1;
}
/*
@ -255,6 +257,7 @@ recvfile(int fd, const char *name, const char *mode)
peer.ss_len) != size) {
alarm(0);
warn("sendto");
txrx_error = 1;
goto abort;
}
write_behind(file, convert);
@ -268,6 +271,7 @@ recvfile(int fd, const char *name, const char *mode)
alarm(0);
if (n < 0) {
warn("recvfrom");
txrx_error = 1;
goto abort;
}
if (!serv.ss_family)
@ -275,6 +279,7 @@ recvfile(int fd, const char *name, const char *mode)
else if (!cmpport((struct sockaddr *)&serv,
(struct sockaddr *)&from)) {
warn("server port mismatch");
txrx_error = 1;
goto abort;
}
peer = from;
@ -325,7 +330,6 @@ recvfile(int fd, const char *name, const char *mode)
stopclock();
if (amount > 0)
printstats("Received", amount);
txrx_error = 1;
}
static int