tftpd: avoid logging error for pxeboot option negotiation?

Ed Maste emaste at freebsd.org
Mon Feb 20 23:02:06 UTC 2012


On Mon, Feb 20, 2012 at 03:39:59PM -0500, Alexander Kabaev wrote:

> IIRC, PXE sends an error packet with zero error code. Could you supress
> the error message in that case and avoid propagation of the 'ignore
> error' flag?
> 
> PXE client is not alone doing that - custom TFTP
> implementation in pxeloader does that as well now, so suppressing errors
> in this case is a good idea.

Thanks for the suggestion, that makes a much simpler patch:

Index: tftp-io.c
===================================================================
--- tftp-io.c	(revision 231851)
+++ tftp-io.c	(working copy)
@@ -463,7 +463,8 @@
 	}
 
 	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 freebsd-hackers mailing list