Date: Tue, 29 Jan 2002 09:10:01 -0800 (PST) From: Maxim Konovalov <maxim@macomnet.ru> To: freebsd-bugs@FreeBSD.org Subject: Re: misc/34412: tftp will still try and receive traffic even after receiver's disk has filled Message-ID: <200201291710.g0THA1d22398@freefall.freebsd.org>
index | next in thread | raw e-mail
The following reply was made to PR misc/34412; it has been noted by GNATS.
From: Maxim Konovalov <maxim@macomnet.ru>
To: Todd Hayton <thayton@torrentnet.com>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: misc/34412: tftp will still try and receive traffic even after
receiver's disk has filled
Date: Tue, 29 Jan 2002 20:00:02 +0300 (MSK)
Here is untested patch for -current (applied for RELENG_2_2_0_RELEASE
too):
Index: tftpd.c
===================================================================
RCS file: /home/ncvs/src/libexec/tftpd/tftpd.c,v
retrieving revision 1.21
diff -u -r1.21 tftpd.c
--- tftpd.c 2001/11/22 05:08:35 1.21
+++ tftpd.c 2002/01/29 16:51:15
@@ -652,7 +652,12 @@
syslog(LOG_ERR, "write: %m");
goto abort;
}
+ errno = 0;
write_behind(file, pf->f_convert);
+ if (errno == ENOSPC) {
+ nak(ENOSPACE);
+ goto abort;
+ }
for ( ; ; ) {
alarm(rexmtval);
n = recv(peer, dp, PKTSIZE, 0);
@@ -683,7 +688,12 @@
goto abort;
}
} while (size == SEGSIZE);
+ errno = 0;
write_behind(file, pf->f_convert);
+ if (errno == ENOSPC) {
+ nak(ENOSPACE);
+ goto abort;
+ }
(void) fclose(file); /* close data file */
ap->th_opcode = htons((u_short)ACK); /* send the "final" ack */
--
Maxim Konovalov, MAcomnet, Internet-Intranet Dept., system engineer
phone: +7 (095) 796-9079, mailto: maxim@macomnet.ru
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200201291710.g0THA1d22398>
