From owner-svn-src-head@FreeBSD.ORG Mon Feb 16 12:09:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66D781065757; Mon, 16 Feb 2009 12:09:53 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 511088FC16; Mon, 16 Feb 2009 12:09:53 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GC9rpv056034; Mon, 16 Feb 2009 12:09:53 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1GC9rb0056033; Mon, 16 Feb 2009 12:09:53 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200902161209.n1GC9rb0056033@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 16 Feb 2009 12:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188669 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 12:10:00 -0000 Author: luigi Date: Mon Feb 16 12:09:52 2009 New Revision: 188669 URL: http://svn.freebsd.org/changeset/base/188669 Log: use a const format string in the log message so we can check the arguments (if/when we enable those checks) Modified: head/sys/netinet/ip_fw2.c Modified: head/sys/netinet/ip_fw2.c ============================================================================== --- head/sys/netinet/ip_fw2.c Mon Feb 16 10:29:03 2009 (r188668) +++ head/sys/netinet/ip_fw2.c Mon Feb 16 12:09:52 2009 (r188669) @@ -3762,8 +3762,8 @@ zero_entry(struct ip_fw_chain *chain, u_ continue; clear_counters(rule, log_only); } - msg = log_only ? "ipfw: All logging counts reset.\n" : - "ipfw: Accounting cleared.\n"; + msg = log_only ? "All logging counts reset" : + "Accounting cleared"; } else { int cleared = 0; /* @@ -3784,13 +3784,18 @@ zero_entry(struct ip_fw_chain *chain, u_ IPFW_WUNLOCK(chain); return (EINVAL); } - msg = log_only ? "ipfw: Entry %d logging count reset.\n" : - "ipfw: Entry %d cleared.\n"; + msg = log_only ? "logging count reset" : "cleared"; } IPFW_WUNLOCK(chain); - if (V_fw_verbose) - log(LOG_SECURITY | LOG_NOTICE, msg, rulenum); + if (V_fw_verbose) { + int lev = LOG_SECURITY | LOG_NOTICE; + + if (rulenum) + log(lev, "ipfw: Entry %d %s.\n", rulenum, msg); + else + log(lev, "ipfw: %s.\n", msg); + } return (0); }