diff options
author | Ed Maste <emaste@FreeBSD.org> | 2012-02-21 14:59:07 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2012-02-21 14:59:07 +0000 |
commit | 9a2856b4397c68f10426b9b0df0b566bd79b4c39 (patch) | |
tree | 2a21f04f76c8bb697fb3406351ae983a2a40ac5c /libexec | |
parent | 526d0bd547574b185147f03c13e2db7abe566a08 (diff) | |
download | src-9a2856b4397c68f10426b9b0df0b566bd79b4c39.tar.gz src-9a2856b4397c68f10426b9b0df0b566bd79b4c39.zip |
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@.
Notes
Notes:
svn path=/head/; revision=231973
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/tftpd/tftp-io.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libexec/tftpd/tftp-io.c b/libexec/tftpd/tftp-io.c index bc5379cb99bc..3ce4f6ef44e7 100644 --- a/libexec/tftpd/tftp-io.c +++ b/libexec/tftpd/tftp-io.c @@ -463,7 +463,8 @@ receive_packet(int peer, char *data, int size, struct sockaddr_storage *from, } 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); } |