Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Feb 2012 14:59:07 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r231973 - head/libexec/tftpd
Message-ID:  <201202211459.q1LEx78t004542@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Tue Feb 21 14:59:07 2012
New Revision: 231973
URL: http://svn.freebsd.org/changeset/base/231973

Log:
  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@.

Modified:
  head/libexec/tftpd/tftp-io.c

Modified: head/libexec/tftpd/tftp-io.c
==============================================================================
--- head/libexec/tftpd/tftp-io.c	Tue Feb 21 14:29:28 2012	(r231972)
+++ head/libexec/tftpd/tftp-io.c	Tue Feb 21 14:59:07 2012	(r231973)
@@ -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);
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202211459.q1LEx78t004542>