svn commit: r239432 - stable/9/libexec/tftpd

Ed Maste emaste at FreeBSD.org
Mon Aug 20 14:52:44 UTC 2012


Author: emaste
Date: Mon Aug 20 14:52:43 2012
New Revision: 239432
URL: http://svn.freebsd.org/changeset/base/239432

Log:
  MFC r231973: Avoid error log for transfer stop w/o error code.
  
  A number of tftp clients, including the one in Intel's pxe boot loader,
  may intentionally stop a transfer using error code 0 (i.e., EUNDEF).
  These are not real errors.  Avoid spamming log files with these by
  logging them at level LOG_DEBUG instead.
  
  Discussed on -hackers with an initial patch proposal; this change is an
  improved approach suggested by kan at .

Modified:
  stable/9/libexec/tftpd/tftp-io.c
Directory Properties:
  stable/9/libexec/tftpd/   (props changed)

Modified: stable/9/libexec/tftpd/tftp-io.c
==============================================================================
--- stable/9/libexec/tftpd/tftp-io.c	Mon Aug 20 14:49:06 2012	(r239431)
+++ stable/9/libexec/tftpd/tftp-io.c	Mon Aug 20 14:52:43 2012	(r239432)
@@ -463,7 +463,8 @@ receive_packet(int peer, char *data, int
 	}
 
 	if (pkt->th_opcode == ERROR) {
-		tftp_log(LOG_ERR, "Got ERROR packet: %s", pkt->th_msg);
+		tftp_log(pkt->th_code == EUNDEF ? LOG_DEBUG : LOG_ERR,
+		    "Got ERROR packet: %s", pkt->th_msg);
 		return (RP_ERROR);
 	}
 


More information about the svn-src-stable mailing list