From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 20 23:02:06 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A21F106566B for ; Mon, 20 Feb 2012 23:02:06 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail1.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id 55E028FC0A for ; Mon, 20 Feb 2012 23:02:06 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com (192.168.222.22) by WTL-EXCH-1.sandvine.com (192.168.196.31) with Microsoft SMTP Server id 14.1.339.1; Mon, 20 Feb 2012 18:02:05 -0500 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id 63C4233C02; Mon, 20 Feb 2012 18:02:05 -0500 (EST) Date: Mon, 20 Feb 2012 18:02:04 -0500 From: Ed Maste To: Alexander Kabaev Message-ID: <20120220230202.GA59361@sandvine.com> References: <20120220200910.GA46212@sandvine.com> <20120220153959.70f57bf4@kan.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20120220153959.70f57bf4@kan.dyndns.org> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@freebsd.org Subject: Re: tftpd: avoid logging error for pxeboot option negotiation? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Feb 2012 23:02:06 -0000 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); }