diff options
author | emaste <emaste@FreeBSD.org> | 2012-02-21 14:59:07 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2012-02-21 14:59:07 +0000 |
commit | 756e1cf258cf7abe129d5a7063135bf10e0e3b0f (patch) | |
tree | 2a21f04f76c8bb697fb3406351ae983a2a40ac5c | |
parent | 80ae8fe82cdaa69f78dc90fa27bc9e79863de0ea (diff) | |
download | FreeBSD-src-756e1cf258cf7abe129d5a7063135bf10e0e3b0f.zip FreeBSD-src-756e1cf258cf7abe129d5a7063135bf10e0e3b0f.tar.gz |
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@.
-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 bc5379c..3ce4f6e 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); } |