From owner-freebsd-bugs Tue Jan 29 9:10: 6 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 9232037B400 for ; Tue, 29 Jan 2002 09:10:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g0THA1d22398; Tue, 29 Jan 2002 09:10:01 -0800 (PST) (envelope-from gnats) Date: Tue, 29 Jan 2002 09:10:01 -0800 (PST) Message-Id: <200201291710.g0THA1d22398@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Maxim Konovalov Subject: Re: misc/34412: tftp will still try and receive traffic even after receiver's disk has filled Reply-To: Maxim Konovalov Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR misc/34412; it has been noted by GNATS. From: Maxim Konovalov To: Todd Hayton 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