mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-11 14:10:34 +00:00
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) MFC after: 2 weeks
This commit is contained in:
parent
b485cf94fb
commit
9dfc434d60
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=201429
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user