From owner-freebsd-questions@FreeBSD.ORG Tue Aug 3 16:48:05 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BAF9C16A4CE; Tue, 3 Aug 2004 16:48:05 +0000 (GMT) Received: from cathy.bmts.com (cathy.bmts.com [216.183.128.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id E233643D49; Tue, 3 Aug 2004 16:48:04 +0000 (GMT) (envelope-from rhempel@bmts.com) Received: from PC300GL (os-dsl-0228.bmts.com [216.183.152.229]) by cathy.bmts.com (8.12.10/8.12.10) with SMTP id i73GmHIo008649; Tue, 3 Aug 2004 12:48:18 -0400 (EDT) From: "Ralph Hempel" To: Date: Tue, 3 Aug 2004 12:50:38 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal In-Reply-To: <200408031633.I73GXIBP038908@asarian-host.net> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 X-bmts-MailScanner: Found to be clean X-bmts-MailScanner-SpamCheck: X-MailScanner-From: rhempel@bmts.com cc: freebsd-hackers@freebsd.org Subject: RE: One OR MORE of source and destination addresses? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: rhempel@bmts.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2004 16:48:05 -0000 > I just took a look at the code: > > if (q != NULL) { /* should never occur */ > if (last_log != time_second) { > last_log = time_second; > printf("ipfw: install_state: entry already present, done\n"); > } > return 0; > } > > What if I just hack the "printf ..." line out of there? Would that 'solve' > it? I know it's dirty; but would things still work? I'll jump in here as a software manager and say NO!!!!! Note, I have no idea if it will still work, but as a professional programmer, the question raises a number of issues :-) 1. First of all, the original programmer took time to comment this line: if (q != NULL) { /* should never occur */ OK. There's no indication WHY it should never occur, but still, the comment is there. 2. By adding this line: if (last_log != time_second) { He's limiting the printed errors to one every second, so you are not beeing flooded with as many messages as are actually ocurring. Is last_log used anywhere else? 3. This line: return 0; will still return 0 if the error occurs, so the program will work the same with or without the diagnostic message. I'd do some more digging and find out exactly WHY this is a "should never occur case" to be sure that the log is not needed. If you don't print the log, then why do the test, except to return 0 :-) Ralph